Probability Distributions概率分布
Sub-topics 4.7, 4.8, 4.9, 4.12 (SL core) and 4.14 (AHL, HL only) of IB AA HL Topic 4. Discrete random variables, expected value, the binomial and normal distributions (SL); variance of a random variable, continuous RVs, linear transformations and sums of independent normals (HL).
本单元覆盖 IB AA HL Topic 4 中的 4.7、4.8、4.9、4.12(SL 核心)与 4.14(AHL,仅 HL)。SL 内容:离散随机变量(discrete random variable)、期望值、二项分布(binomial distribution)与正态分布(normal distribution);HL 内容:随机变量的方差、连续随机变量(continuous random variable)、线性变换(linear transformation)与独立正态分布之和。
Unit D3 Cheat-SheetD3 单元小抄
Every formula in D3 fits on this single card. SL core on the left, HL-only on the right. If you only have ten minutes before the exam, memorize this.
D3 所有公式压缩在这张卡片上。左边是 SL 核心,右边是 HL 专属。考前只剩十分钟,就背这一张。
Every SL formula in D3 fits on this single card. If you only have ten minutes before the exam, memorize this.
D3 的全部 SL 公式压缩在这张卡片上。考前只剩十分钟,就背这一张。
Discrete RV mean:离散随机变量的均值:
$$ E(X) = \sum x_i\, P(X = x_i). $$Binomial $X \sim B(n, p)$:二项分布 $X \sim B(n, p)$:
$$ P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}, $$ $$ E(X) = np, \qquad \text{Var}(X) = np(1-p). $$Normal $X \sim N(\mu, \sigma^2)$:正态分布 $X \sim N(\mu, \sigma^2)$:
$$ Z = \frac{X - \mu}{\sigma} \sim N(0, 1). $$68 / 95 / 99.7 within $\pm 1\sigma / 2\sigma / 3\sigma$. GDC: normCdf(a, b, μ, σ), invNorm(p, μ, σ).
68-95-99.7 法则(empirical rule)对应 $\pm 1\sigma / 2\sigma / 3\sigma$。GDC:normCdf(a, b, μ, σ)、invNorm(p, μ, σ)。
Variance (computational form; the definition is $E[(X - \mu)^2]$, see 3.3):方差(计算形式;定义为 $E[(X - \mu)^2]$,见 3.3 节):
$$ \text{Var}(X) = E(X^2) - [E(X)]^2. $$Linear transformation:线性变换:
$$ E(aX + b) = aE(X) + b, $$ $$ \text{Var}(aX + b) = a^{2}\, \text{Var}(X). $$Sum / difference, indep. RVs:独立随机变量之和 / 之差:
$$ E(X \pm Y) = E(X) \pm E(Y), $$ $$ \text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y). $$Sum of independent normals:独立正态分布之和:
$$ X \sim N(\mu_1, \sigma_1^2),\; Y \sim N(\mu_2, \sigma_2^2) \;\Longrightarrow\; X + Y \sim N(\mu_1 + \mu_2,\; \sigma_1^2 + \sigma_2^2). $$probability density function / PDF)满足 $f(x) \ge 0$ 与 $\int_{-\infty}^{\infty} f(x)\,dx = 1$。概率、均值、方差和中位数(median)都用积分表达:
$$ P(a \le X \le b) = \int_{a}^{b} f(x)\,dx, \quad E(X) = \int_{-\infty}^{\infty} x\, f(x)\, dx, $$
$$ \text{Var}(X) = \int_{-\infty}^{\infty} x^{2}\, f(x)\, dx - \mu^{2}, \quad \int_{-\infty}^{m} f(x)\,dx = \tfrac{1}{2}. $$
3.1 Discrete Random Variables3.1 离散随机变量 SL 4.7
- Define a discrete random variable and its probability distribution.
- State the two conditions a table must satisfy to be a probability distribution.
- Find an unknown probability or constant by using $\sum P(X = x_i) = 1$.
- Calculate the probability of an event such as $P(X \ge 2)$ by adding the relevant entries.
- Distinguish $P(X < k)$ from $P(X \le k)$ for a discrete random variable.
- 定义(
define)离散随机变量及其概率分布。 - 写出(
state)一张表成为概率分布必须满足的两个条件。 - 利用 $\sum P(X = x_i) = 1$ 求出(
find)未知概率或常数。 - 把相关取值的概率相加,计算(
calculate)$P(X \ge 2)$ 这类事件的概率。 - 区分(
distinguish)离散随机变量的 $P(X < k)$ 与 $P(X \le k)$。
discrete random variable)$X$ 取一组取值 $x_1, x_2, \ldots$,对应概率 $P(X = x_i)$ 之和为 $1$。
所有 (取值, 概率) 对组成的列表就是 $X$ 的概率分布(probability distribution)。两条不可妥协的公理:
$$ P(X = x_i) \ge 0, \qquad \sum_{i} P(X = x_i) = 1. $$
一张表是不是真正的概率分布,只需要核对这两条规则。
random variable)本质上是一个把实验结果映射到数字的函数。掷骰子时,令 $X$ = 朝上面的点数,这就是一个离散随机变量,取值集合为 $\{1, 2, 3, 4, 5, 6\}$,每个值的概率都是 $\tfrac{1}{6}$。分布本身并不关心每个结果为何具有那种概率,它只关心值和概率是什么。这种抽象正是同一套工具能同时处理骰子、抛硬币、服务器请求和考试成绩的原因。
Worked Example: Verifying a distribution例题:验证一个分布
Problem: The random variable $X$ has distribution $P(X = 0) = 0.1$, $P(X = 1) = k$, $P(X = 2) = 0.3$, $P(X = 3) = 0.2$. Find $k$ and then compute $P(X \ge 2)$.
Apply $\sum P = 1$:
$$ 0.1 + k + 0.3 + 0.2 = 1 \;\Longrightarrow\; k = 0.4. $$Now sum the events $X = 2$ and $X = 3$:
$$ P(X \ge 2) = 0.3 + 0.2 = 0.5. $$题目:随机变量 $X$ 的分布为 $P(X = 0) = 0.1$,$P(X = 1) = k$,$P(X = 2) = 0.3$,$P(X = 3) = 0.2$。 求 $k$,并计算 $P(X \ge 2)$。
应用 $\sum P = 1$:
$$ 0.1 + k + 0.3 + 0.2 = 1 \;\Longrightarrow\; k = 0.4. $$对 $X = 2$ 和 $X = 3$ 两个事件求和:
$$ P(X \ge 2) = 0.3 + 0.2 = 0.5. $$Worked Example: Distribution from a rule例题:由规则给出的分布
Problem: A discrete RV $X$ has $P(X = x) = c \cdot x$ for $x \in \{1, 2, 3, 4\}$ and $0$ elsewhere. Find $c$ and tabulate the distribution.
Sum the probabilities and set equal to $1$:
$$ c(1 + 2 + 3 + 4) = 10 c = 1 \;\Longrightarrow\; c = \tfrac{1}{10}. $$Distribution:
| $x$ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| $P(X = x)$ | $0.1$ | $0.2$ | $0.3$ | $0.4$ |
题目:离散随机变量 $X$ 满足 $P(X = x) = c \cdot x$,其中 $x \in \{1, 2, 3, 4\}$,其余取值概率为 $0$。求 $c$ 并列出分布表。
把全部概率相加并令其等于 $1$:
$$ c(1 + 2 + 3 + 4) = 10 c = 1 \;\Longrightarrow\; c = \tfrac{1}{10}. $$分布表:
| $x$ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| $P(X = x)$ | $0.1$ | $0.2$ | $0.3$ | $0.4$ |
▸ Going deeper: Cumulative distribution function (CDF)▸ 深入:累积分布函数(CDF)
For a discrete RV $X$, the cumulative distribution function (CDF) is
$$ F(x) = P(X \le x) = \sum_{x_i \le x} P(X = x_i). $$$F$ is a non-decreasing step function from $0$ to $1$. Two facts to know:
- $P(a < X \le b) = F(b) - F(a)$: take care with strict vs. weak inequalities for discrete RVs.
- $P(X \ge k) = 1 - F(k - 1)$: the "$1$ minus CDF" trick is the standard route for tail probabilities, especially with binomial on the GDC.
On a GDC, binomCdf(n, p, k) returns $P(X \le k)$ for $X \sim B(n, p)$. To get $P(X > k)$, compute 1 − binomCdf(n, p, k); to get $P(X \ge k)$, compute 1 − binomCdf(n, p, k − 1).
对离散随机变量 $X$,累积分布函数(cumulative distribution function / CDF)定义为
$F$ 是从 $0$ 上升到 $1$ 的非递减阶梯函数。需要掌握的两件事:
- $P(a < X \le b) = F(b) - F(a)$:离散随机变量的严格不等号与非严格不等号必须分清。
- $P(X \ge k) = 1 - F(k - 1)$:"$1$ 减 CDF"的技巧是处理尾部概率的标准套路,尤其是用 GDC 算二项分布时。
在图形计算器(GDC)上,binomCdf(n, p, k) 返回 $X \sim B(n, p)$ 时的 $P(X \le k)$。要算 $P(X > k)$,用 1 − binomCdf(n, p, k);要算 $P(X \ge k)$,用 1 − binomCdf(n, p, k − 1)。
When a table contains an unknown such as $k$, write the full equation $\sum P(X = x_i) = 1$ before solving, then substitute back and check that every probability lies between $0$ and $1$; a value of $k$ that makes any entry negative (for example one root of a quadratic) must be rejected, with a reason. For a discrete variable, $P(X < 3)$ and $P(X \le 3)$ are different events: list the values you are including before adding.
表中含未知数(如 $k$)时,先完整写出方程 $\sum P(X = x_i) = 1$ 再求解,然后代回检查每个概率都在 $0$ 与 $1$ 之间;若某个 $k$(例如二次方程的一个根)使某项为负,必须舍去(reject)并说明理由。对离散变量,$P(X < 3)$ 与 $P(X \le 3)$ 是不同的事件:相加之前先列出所包含的取值。
A table gives $P(X = 1) = 0.5$, $P(X = 2) = 0.6$, $P(X = 3) = -0.1$. The probabilities sum to $1$. Is this a probability distribution?某表给出 $P(X = 1) = 0.5$,$P(X = 2) = 0.6$,$P(X = 3) = -0.1$,概率之和为 $1$。这是概率分布吗?
No. Summing to $1$ is only one of the two conditions; every probability must also satisfy $0 \le P(X = x_i) \le 1$, and $P(X = 3) = -0.1$ is negative.
不是。和为 $1$ 只是两个条件之一;每个概率还必须满足 $0 \le P(X = x_i) \le 1$,而 $P(X = 3) = -0.1$ 为负。
Two fair coins are tossed and $X$ is the number of heads. Write down the probability distribution of $X$ and find $P(X \ge 1)$.抛两枚均匀硬币,$X$ 为正面朝上的个数。写出 $X$ 的概率分布,并求 $P(X \ge 1)$。
The outcomes HH, HT, TH, TT are equally likely, so $P(X = 0) = \tfrac{1}{4}$, $P(X = 1) = \tfrac{2}{4} = \tfrac{1}{2}$, $P(X = 2) = \tfrac{1}{4}$. Then $P(X \ge 1) = 1 - P(X = 0) = \tfrac{3}{4}$.
HH、HT、TH、TT 四种结果等可能,故 $P(X = 0) = \tfrac{1}{4}$,$P(X = 1) = \tfrac{2}{4} = \tfrac{1}{2}$,$P(X = 2) = \tfrac{1}{4}$。于是 $P(X \ge 1) = 1 - P(X = 0) = \tfrac{3}{4}$。
$P(X = x) = k x^{2}$ for $x = 1, 2, 3$. Find $k$ and $P(X > 1)$.$P(X = x) = k x^{2}$,$x = 1, 2, 3$。求 $k$ 与 $P(X > 1)$。
$k(1 + 4 + 9) = 14k = 1$, so $k = \tfrac{1}{14}$. Then $P(X > 1) = P(X = 2) + P(X = 3) = \tfrac{4}{14} + \tfrac{9}{14} = \tfrac{13}{14}$ (or $1 - \tfrac{1}{14}$).
$k(1 + 4 + 9) = 14k = 1$,故 $k = \tfrac{1}{14}$。于是 $P(X > 1) = P(X = 2) + P(X = 3) = \tfrac{4}{14} + \tfrac{9}{14} = \tfrac{13}{14}$(或 $1 - \tfrac{1}{14}$)。
With the distribution $P(X = x) = \tfrac{x}{10}$ for $x = 1, 2, 3, 4$, find $P(X < 3)$ and $P(X \le 3)$.分布为 $P(X = x) = \tfrac{x}{10}$,$x = 1, 2, 3, 4$。求 $P(X < 3)$ 与 $P(X \le 3)$。
$P(X < 3) = P(X = 1) + P(X = 2) = 0.1 + 0.2 = 0.3$. $P(X \le 3)$ also includes $x = 3$: $0.3 + 0.3 = 0.6$ (equivalently $1 - P(X = 4) = 1 - 0.4$).
$P(X < 3) = P(X = 1) + P(X = 2) = 0.1 + 0.2 = 0.3$。$P(X \le 3)$ 还包括 $x = 3$:$0.3 + 0.3 = 0.6$(等价于 $1 - P(X = 4) = 1 - 0.4$)。
3.2 Expected Value $E(X)$3.2 期望值 $E(X)$ SL 4.7
- Calculate $E(X) = \sum x_i\, P(X = x_i)$ from a probability distribution table.
- Interpret $E(X)$ as the long-run mean value of $X$ over many repetitions.
- Define the net gain of a game and decide whether the game is fair.
- Find an unknown stake, prize or probability by setting $E(\text{net gain}) = 0$.
- Calculate an expected profit or cost in an applied context.
- 由概率分布表计算(
calculate)$E(X) = \sum x_i\, P(X = x_i)$。 - 把 $E(X)$ 解释(
interpret)为多次重复后 $X$ 的长期平均值。 - 定义游戏的净收益(
net gain),并判断(determine)游戏是否公平。 - 令 $E(\text{net gain}) = 0$,求出(
find)未知的赌注、奖金或概率。 - 在应用情境中计算期望利润或期望成本。
expected value)就是用概率加权得到的取值平均。
$$ E(X) = \mu = \sum_{i} x_i\, P(X = x_i). $$
$E(X)$ 是长期平均:把同一个实验重复非常多次时,每次试验的平均值所趋近的数值。它本身不必是 $X$ 真正能取到的值(比如骰子的 $E(X) = 3.5$)。
For a function $g$ of $X$, the law of the unconscious statistician (LOTUS):
对 $X$ 的函数 $g$,使用无意识统计学家定律(LOTUS):
fair game)。若 $E(\text{net gain}) > 0$,游戏对玩家有利;若 $E(\text{net gain}) < 0$,游戏对庄家(house)有利。公平游戏题要么问"游戏公平吗?",要么问"赌注定为多少游戏才公平?";两类问题都归结为求出 $E(\text{net gain})$,令其等于 $0$ 并求解。
Worked Example: Expected value of a die例题:骰子的期望值
Problem: $X$ is the number shown on a fair six-sided die. Find $E(X)$.
Each value $1, 2, \ldots, 6$ has probability $\tfrac{1}{6}$. Apply the definition:
$$ E(X) = \sum_{x=1}^{6} x \cdot \tfrac{1}{6} = \tfrac{1}{6}(1 + 2 + 3 + 4 + 5 + 6) = \tfrac{21}{6} = 3.5. $$So the long-run average roll is $3.5$, even though $3.5$ is never an actual outcome.
题目:$X$ 表示一颗均匀六面骰子掷出的点数。求 $E(X)$。
每个取值 $1, 2, \ldots, 6$ 的概率都是 $\tfrac{1}{6}$。按定义计算:
$$ E(X) = \sum_{x=1}^{6} x \cdot \tfrac{1}{6} = \tfrac{1}{6}(1 + 2 + 3 + 4 + 5 + 6) = \tfrac{21}{6} = 3.5. $$长期平均点数是 $3.5$,尽管骰子永远掷不出 $3.5$ 这个数。
Worked Example: Fair game例题:公平游戏
Problem: A carnival game costs 3 dollars to play. You roll a fair die: if you roll a $6$ you win $k$ dollars, otherwise you win nothing. Find the value of $k$ that makes the game fair.
Let $G$ = net gain. Then $G = k - 3$ with probability $\tfrac{1}{6}$ and $G = -3$ with probability $\tfrac{5}{6}$:
$$ E(G) = \tfrac{1}{6}(k - 3) + \tfrac{5}{6}(-3) = \tfrac{k - 3}{6} - \tfrac{15}{6} = \tfrac{k - 18}{6}. $$Set $E(G) = 0$:
$$ k - 18 = 0 \;\Longrightarrow\; k = 18. $$So the prize must be 18 dollars for the game to be fair. Why this works: a fair game is defined by zero expected net gain, and the stake is paid on every play, including the winning one.
题目:嘉年华游戏每玩一次收费 3 美元。你掷一颗均匀骰子:掷到 $6$ 赢得 $k$ 美元,否则一分不得。求使游戏公平的 $k$。
设 $G$ = 净收益。则 $G = k - 3$ 的概率为 $\tfrac{1}{6}$,$G = -3$ 的概率为 $\tfrac{5}{6}$:
$$ E(G) = \tfrac{1}{6}(k - 3) + \tfrac{5}{6}(-3) = \tfrac{k - 3}{6} - \tfrac{15}{6} = \tfrac{k - 18}{6}. $$令 $E(G) = 0$:
$$ k - 18 = 0 \;\Longrightarrow\; k = 18. $$所以奖金需定为 18 美元才公平。原理:公平游戏的定义是净收益期望为零,而且每局都要先付赌注,赢的那一局也不例外。
Worked Example: Insurance例题:保险
Problem: An insurer charges a premium of 200 dollars for a one-year policy. The probability that a claim occurs is $0.04$, with payout 3000 dollars. Find the insurer's expected profit per policy.
Let $P$ = profit. Then $P = 200$ with probability $0.96$ and $P = 200 - 3000 = -2800$ with probability $0.04$:
$$ E(P) = 0.96(200) + 0.04(-2800) = 192 - 112 = 80. $$So the insurer expects to make 80 dollars profit on average per policy.
题目:保险公司对一年期保单收取 200 美元保费。出险概率为 $0.04$,理赔金为 3000 美元。求保险公司每张保单的期望利润。
设 $P$ = 利润。则 $P = 200$ 的概率为 $0.96$,$P = 200 - 3000 = -2800$ 的概率为 $0.04$:
$$ E(P) = 0.96(200) + 0.04(-2800) = 192 - 112 = 80. $$保险公司平均每张保单期望盈利 80 美元。
In a game question, define the random variable in words first ("let $G$ be the net gain in dollars") and decide whether the stake is subtracted from every outcome. Writing the prize as the gain, without subtracting the stake, is the usual source of a wrong answer. To show a game is fair, show $E(G) = 0$ with the working, then state the conclusion in a sentence; to say who it favours, compare $E(G)$ with $0$.
做游戏类题目时,先用文字定义随机变量("设 $G$ 为以美元计的净收益"),并确认赌注是否要从每个结果中扣除。把奖金直接当作收益而不减去赌注,是最常见的错误来源。要证明(show that)游戏公平,写出过程并得到 $E(G) = 0$,再用一句话写出结论;要判断游戏对谁有利,就把 $E(G)$ 与 $0$ 比较。
Explain why $E(X) = 3.5$ for a fair die even though $3.5$ can never be rolled.解释为什么均匀骰子的 $E(X) = 3.5$,尽管永远掷不出 $3.5$。
$E(X)$ is a probability-weighted mean, not a possible outcome: it is the value the average of many rolls approaches. Averages of whole numbers need not be whole numbers.
$E(X)$ 是按概率加权的平均值,而不是某个可能的结果:它是大量投掷的平均值所趋近的数。整数的平均值不一定是整数。
$X$ takes values $0, 1, 2, 3$ with probabilities $0.1, 0.3, 0.4, 0.2$. Find $E(X)$.$X$ 取值 $0, 1, 2, 3$,概率分别为 $0.1, 0.3, 0.4, 0.2$。求 $E(X)$。
$E(X) = 0(0.1) + 1(0.3) + 2(0.4) + 3(0.2) = 0 + 0.3 + 0.8 + 0.6 = 1.7$.
$E(X) = 0(0.1) + 1(0.3) + 2(0.4) + 3(0.2) = 0 + 0.3 + 0.8 + 0.6 = 1.7$。
A game costs 2 dollars. A fair coin is tossed twice; if both are heads the player receives 6 dollars, otherwise nothing. Find the expected net gain and say whether the game is fair.一个游戏收费 2 美元。抛两次均匀硬币;若两次都是正面,玩家得到 6 美元,否则一无所获。求净收益的期望,并判断游戏是否公平。
$P(\text{HH}) = \tfrac{1}{4}$. Net gain $G = 6 - 2 = 4$ with probability $\tfrac{1}{4}$ and $G = -2$ with probability $\tfrac{3}{4}$. $E(G) = \tfrac{1}{4}(4) + \tfrac{3}{4}(-2) = 1 - 1.5 = -0.5$. Not fair: the player loses 0.5 dollars per game on average.
$P(\text{HH}) = \tfrac{1}{4}$。净收益 $G = 6 - 2 = 4$ 的概率为 $\tfrac{1}{4}$,$G = -2$ 的概率为 $\tfrac{3}{4}$。$E(G) = \tfrac{1}{4}(4) + \tfrac{3}{4}(-2) = 1 - 1.5 = -0.5$。不公平:玩家平均每局损失 0.5 美元。
$X$ takes values $1, 2, 4$ with probabilities $0.5, p, 0.5 - p$, and $E(X) = 2$. Find $p$.$X$ 取值 $1, 2, 4$,概率分别为 $0.5, p, 0.5 - p$,且 $E(X) = 2$。求 $p$。
$E(X) = 0.5 + 2p + 4(0.5 - p) = 0.5 + 2p + 2 - 4p = 2.5 - 2p$. Setting $2.5 - 2p = 2$ gives $p = 0.25$. Check: the probabilities $0.5, 0.25, 0.25$ are all in $[0, 1]$ and sum to $1$.
$E(X) = 0.5 + 2p + 4(0.5 - p) = 0.5 + 2p + 2 - 4p = 2.5 - 2p$。令 $2.5 - 2p = 2$,得 $p = 0.25$。验算:概率 $0.5, 0.25, 0.25$ 都在 $[0, 1]$ 内,且和为 $1$。
3.3 Variance of a Discrete RV3.3 离散随机变量的方差 AHL 4.14 HL
- State the definition $\text{Var}(X) = E[(X - \mu)^{2}]$ and explain why deviations are squared.
- Show that $\text{Var}(X) = E(X^{2}) - [E(X)]^{2}$.
- Calculate $E(X^{2})$, $\text{Var}(X)$ and the standard deviation from a distribution table.
- Compare the spreads of two random variables with the same mean.
- Use a given variance to find an unknown value or probability in a distribution.
- 写出(
state)定义 $\text{Var}(X) = E[(X - \mu)^{2}]$,并解释(explain)为什么要把偏差平方。 - 证明(
show that)$\text{Var}(X) = E(X^{2}) - [E(X)]^{2}$。 - 由分布表计算(
calculate)$E(X^{2})$、$\text{Var}(X)$ 与标准差。 - 比较(
compare)两个均值相同的随机变量的离散程度。 - 利用已知方差求出分布中的未知取值或概率。
variance)衡量取值相对于均值的平均平方偏差。两个等价公式,第二个通常更快:
$$ \text{Var}(X) = E\!\left[(X - \mu)^2\right] = E(X^2) - [E(X)]^2. $$
从分布表算出 $E(X^2) = \sum x_i^2\, P(X = x_i)$,把 $E(X)$ 平方,再相减。标准差(standard deviation)$\sigma = \sqrt{\text{Var}(X)}$。
Standard deviation $\sigma = \sqrt{\text{Var}(X)}$. Variance has units of "$X$-squared"; SD has the units of $X$, so SD is what you report.
标准差 $\sigma = \sqrt{\text{Var}(X)}$。方差的单位是"$X$ 的平方";标准差的单位与 $X$ 相同,所以最终汇报时用的是标准差。
▸ Going deeper: Deriving $\text{Var}(X) = E(X^{2}) - \mu^{2}$▸ 深入:推导 $\text{Var}(X) = E(X^{2}) - \mu^{2}$
Start from the definition and expand the square:
$$ \text{Var}(X) = E\!\left[(X - \mu)^{2}\right] = E\!\left[X^{2} - 2\mu X + \mu^{2}\right]. $$Linearity of expectation (see 3.8) gives $E(aX + b) = aE(X) + b$. Apply it term by term, remembering that $\mu = E(X)$ is a constant:
$$ = E(X^{2}) - 2\mu\, E(X) + \mu^{2} = E(X^{2}) - 2\mu \cdot \mu + \mu^{2} = E(X^{2}) - \mu^{2}. \;\;\blacksquare $$This is the form to use for calculation. The other form, $E[(X - \mu)^{2}]$, makes the meaning clearer (average squared deviation) but is usually slower to evaluate by hand.
从定义出发,把平方展开:
$$ \text{Var}(X) = E\!\left[(X - \mu)^{2}\right] = E\!\left[X^{2} - 2\mu X + \mu^{2}\right]. $$期望的线性性(linearity of expectation,见 3.8 节)给出 $E(aX + b) = aE(X) + b$。逐项使用,注意 $\mu = E(X)$ 是常数:
这是计算时应使用的形式。另一种形式 $E[(X - \mu)^{2}]$ 更直观(平均平方偏差),但手算时通常更慢。
Worked Example: Variance from a table例题:由分布表求方差
Problem: $X$ has distribution $P(X = 1) = 0.1$, $P(X = 2) = 0.4$, $P(X = 3) = 0.3$, $P(X = 4) = 0.2$. Find $\text{Var}(X)$ and the standard deviation.
First compute $E(X)$:
$$ E(X) = (1)(0.1) + (2)(0.4) + (3)(0.3) + (4)(0.2) = 0.1 + 0.8 + 0.9 + 0.8 = 2.6. $$Then $E(X^{2})$:
$$ E(X^{2}) = (1)(0.1) + (4)(0.4) + (9)(0.3) + (16)(0.2) = 0.1 + 1.6 + 2.7 + 3.2 = 7.6. $$Variance and SD:
$$ \text{Var}(X) = E(X^{2}) - \mu^{2} = 7.6 - (2.6)^{2} = 7.6 - 6.76 = 0.84. $$ $$ \sigma = \sqrt{0.84} \approx 0.917. $$题目:$X$ 的分布为 $P(X = 1) = 0.1$,$P(X = 2) = 0.4$,$P(X = 3) = 0.3$,$P(X = 4) = 0.2$。求 $\text{Var}(X)$ 和标准差。
先算 $E(X)$:
$$ E(X) = (1)(0.1) + (2)(0.4) + (3)(0.3) + (4)(0.2) = 0.1 + 0.8 + 0.9 + 0.8 = 2.6. $$再算 $E(X^{2})$:
$$ E(X^{2}) = (1)(0.1) + (4)(0.4) + (9)(0.3) + (16)(0.2) = 0.1 + 1.6 + 2.7 + 3.2 = 7.6. $$方差与标准差:
$$ \text{Var}(X) = E(X^{2}) - \mu^{2} = 7.6 - (2.6)^{2} = 7.6 - 6.76 = 0.84. $$ $$ \sigma = \sqrt{0.84} \approx 0.917. $$Worked Example: Comparing spreads例题:比较离散程度
Problem: $X$ has $P(X = 0) = P(X = 4) = 0.5$. $Y$ has $P(Y = 1) = P(Y = 3) = 0.5$. Both have mean $2$. Compare their variances.
For $X$: $E(X^{2}) = (0)(0.5) + (16)(0.5) = 8$, so $\text{Var}(X) = 8 - 4 = 4$, $\sigma_{X} = 2$.
For $Y$: $E(Y^{2}) = (1)(0.5) + (9)(0.5) = 5$, so $\text{Var}(Y) = 5 - 4 = 1$, $\sigma_{Y} = 1$.
Same mean, very different spreads: every value of $X$ is $2$ from the mean and every value of $Y$ is $1$ from the mean, so $\sigma_{X} = 2\sigma_{Y}$ and $\text{Var}(X) = 4\,\text{Var}(Y)$. Why this works: the mean only locates the centre; variance measures how far the values sit from it.
题目:$X$ 满足 $P(X = 0) = P(X = 4) = 0.5$。$Y$ 满足 $P(Y = 1) = P(Y = 3) = 0.5$。两者均值都是 $2$。比较它们的方差。
对 $X$:$E(X^{2}) = (0)(0.5) + (16)(0.5) = 8$,所以 $\text{Var}(X) = 8 - 4 = 4$,$\sigma_{X} = 2$。
对 $Y$:$E(Y^{2}) = (1)(0.5) + (9)(0.5) = 5$,所以 $\text{Var}(Y) = 5 - 4 = 1$,$\sigma_{Y} = 1$。
均值相同,离散程度差别很大:$X$ 的每个取值离均值都是 $2$,$Y$ 的每个取值离均值都是 $1$,所以 $\sigma_{X} = 2\sigma_{Y}$,$\text{Var}(X) = 4\,\text{Var}(Y)$。原理:均值只确定中心位置;方差衡量取值离中心有多远。
Set out a variance calculation as three labelled lines: $E(X) = \ldots$, $E(X^{2}) = \ldots$, $\text{Var}(X) = E(X^{2}) - [E(X)]^{2} = \ldots$. Square the values, not the probabilities, when you form $E(X^{2})$. Keep exact values until the last line, and if the question asks for the standard deviation, take the square root at the end. A variance can never be negative; a negative answer means an arithmetic slip.
方差计算按三行带标签的步骤写出:$E(X) = \ldots$,$E(X^{2}) = \ldots$,$\text{Var}(X) = E(X^{2}) - [E(X)]^{2} = \ldots$。构造 $E(X^{2})$ 时平方的是取值,而不是概率。最后一行之前都保留精确值;若题目要求标准差(standard deviation),最后再开方。方差不可能为负;得到负值说明计算出错。
Explain why $\text{Var}(X) \ge 0$ for every random variable, and when it equals $0$.解释为什么任何随机变量都有 $\text{Var}(X) \ge 0$,以及何时等于 $0$。
$\text{Var}(X) = \sum (x_i - \mu)^{2} P(X = x_i)$ is a sum of non-negative terms, so it is non-negative. It equals $0$ only when every value with non-zero probability equals $\mu$, i.e. $X$ is constant.
$\text{Var}(X) = \sum (x_i - \mu)^{2} P(X = x_i)$ 是非负项之和,所以非负。只有当所有概率不为零的取值都等于 $\mu$(即 $X$ 为常数)时才等于 $0$。
$X$ is the score on a fair six-sided die. Given $E(X) = 3.5$, find $\text{Var}(X)$.$X$ 为均匀六面骰子的点数。已知 $E(X) = 3.5$,求 $\text{Var}(X)$。
$E(X^{2}) = \tfrac{1}{6}(1 + 4 + 9 + 16 + 25 + 36) = \tfrac{91}{6}$. $\text{Var}(X) = \tfrac{91}{6} - \tfrac{49}{4} = \tfrac{182 - 147}{12} = \tfrac{35}{12} \approx 2.92$.
$E(X^{2}) = \tfrac{1}{6}(1 + 4 + 9 + 16 + 25 + 36) = \tfrac{91}{6}$。$\text{Var}(X) = \tfrac{91}{6} - \tfrac{49}{4} = \tfrac{182 - 147}{12} = \tfrac{35}{12} \approx 2.92$。
$X$ takes values $0$ and $a$ ($a > 0$), each with probability $0.5$, and $\text{Var}(X) = 9$. Find $a$.$X$ 取值 $0$ 与 $a$($a > 0$),概率各为 $0.5$,且 $\text{Var}(X) = 9$。求 $a$。
$E(X) = \tfrac{a}{2}$ and $E(X^{2}) = \tfrac{a^{2}}{2}$, so $\text{Var}(X) = \tfrac{a^{2}}{2} - \tfrac{a^{2}}{4} = \tfrac{a^{2}}{4} = 9$. Hence $a^{2} = 36$ and, since $a > 0$, $a = 6$.
$E(X) = \tfrac{a}{2}$,$E(X^{2}) = \tfrac{a^{2}}{2}$,故 $\text{Var}(X) = \tfrac{a^{2}}{2} - \tfrac{a^{2}}{4} = \tfrac{a^{2}}{4} = 9$。所以 $a^{2} = 36$,又因 $a > 0$,得 $a = 6$。
A student computes $E(X^{2}) = 5$ and $E(X) = 3$ and reports $\text{Var}(X) = -4$. What does this show?某学生算得 $E(X^{2}) = 5$、$E(X) = 3$,并给出 $\text{Var}(X) = -4$。这说明了什么?
At least one of the two values is wrong. Since $\text{Var}(X) \ge 0$, we always have $E(X^{2}) \ge [E(X)]^{2}$, and $5 < 9$ breaks this. Recheck both sums (a common slip is squaring the probabilities instead of the values).
两个值中至少有一个算错了。由于 $\text{Var}(X) \ge 0$,必有 $E(X^{2}) \ge [E(X)]^{2}$,而 $5 < 9$ 违反了这一点。重新检查两个求和(常见错误是把概率而不是取值平方)。
3.4 Binomial Distribution3.4 二项分布 SL 4.8
- State the four conditions for a binomial model and justify each one in context.
- Define the random variable in words and write $X \sim B(n, p)$.
- Calculate $P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}$ by hand and with technology.
- Calculate cumulative probabilities such as $P(X \ge k)$ by rewriting them in "$\le$" form.
- Use $E(X) = np$ and $\text{Var}(X) = np(1-p)$.
- 写出(
state)二项模型的四个条件,并结合情境逐一说明(justify)。 - 用文字定义随机变量,并写出 $X \sim B(n, p)$。
- 手算或用技术工具计算(
calculate)$P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}$。 - 把 $P(X \ge k)$ 等累积概率改写成"$\le$"形式后计算。
- 使用 $E(X) = np$ 与 $\text{Var}(X) = np(1-p)$。
binomPdf(n, p, k) for $P(X = k)$ and binomCdf(n, p, k) for $P(X \le k)$.
Bernoulli trial)中"成功"的次数,每次试验成功概率为 $p$。
$$ P(X = k) = \binom{n}{k}\, p^{k}\, (1-p)^{n-k}, \quad k = 0, 1, \ldots, n. $$
均值与方差:
$$ E(X) = np, \qquad \text{Var}(X) = np(1 - p). $$
GDC 上用 binomPdf(n, p, k) 计算 $P(X = k)$,用 binomCdf(n, p, k) 计算 $P(X \le k)$。
- Fixed number of trials $n$.
- Two outcomes per trial: success or failure.
- Constant success probability $p$ across trials.
- Independent trials.
- 试验次数 $n$ 固定。
- 每次试验只有两种结果:成功或失败。
- 各次试验的成功概率 $p$ 恒定。
- 各次试验相互独立。
hypergeometric),而不是二项分布。若样本相对总体很小(经验法则:低于 $10\%$),二项分布是很好的近似。做题时要找出支持每个条件的字眼("independently"、"with replacement"、"每次概率为 $p$")。
skewed to the right);各柱在均值 $np = 3$ 处平衡。$P(X \le 2)$ 是前三根柱之和:$0.0282 + 0.1211 + 0.2335 \approx 0.383$。▸ Going deeper: Why $E(X) = np$▸ 深入:为什么 $E(X) = np$
Write $X = X_{1} + X_{2} + \cdots + X_{n}$ where $X_{i} = 1$ if trial $i$ is a success and $X_{i} = 0$ otherwise. Each $X_{i}$ is a Bernoulli RV with $E(X_{i}) = p$ (since $E(X_{i}) = 1 \cdot p + 0 \cdot (1 - p) = p$). The expected value of a sum is the sum of the expected values, so
$$ E(X) = E(X_{1}) + E(X_{2}) + \cdots + E(X_{n}) = np. $$For variance (HL), each $X_{i}$ has $E(X_{i}^{2}) = p$ (since $X_{i}^{2} = X_{i}$ for a $\{0, 1\}$ variable), so $\text{Var}(X_{i}) = p - p^{2} = p(1 - p)$. The $X_{i}$ are independent, so variances add (Section 3.8):
$$ \text{Var}(X) = n \cdot p(1 - p). $$This decomposition into Bernoulli pieces is the cleanest derivation. It also generalizes immediately: any sum of $n$ independent Bernoulli$(p)$ trials is binomial, regardless of whether they come from "the same experiment."
写 $X = X_{1} + X_{2} + \cdots + X_{n}$,其中第 $i$ 次成功则 $X_{i} = 1$,否则 $X_{i} = 0$。每个 $X_{i}$ 都是伯努利(Bernoulli)随机变量,$E(X_{i}) = p$(因为 $E(X_{i}) = 1 \cdot p + 0 \cdot (1 - p) = p$)。和的期望等于期望之和,所以
对方差(HL),每个 $X_{i}$ 满足 $E(X_{i}^{2}) = p$(取值在 $\{0, 1\}$ 的变量满足 $X_{i}^{2} = X_{i}$),故 $\text{Var}(X_{i}) = p - p^{2} = p(1 - p)$。各 $X_{i}$ 独立,所以方差可加(见 3.8 节):
$$ \text{Var}(X) = n \cdot p(1 - p). $$把二项变量拆成伯努利分量是最干净的推导路线。它还能立刻推广:任意 $n$ 个独立 Bernoulli$(p)$ 试验之和都是二项分布,不管它们是不是来自"同一个实验"。
Worked Example: Exact probability例题:精确概率
Problem: A test consists of $10$ multiple-choice questions, each with $4$ options. A student guesses every answer. Find the probability of getting exactly $4$ correct.
$X$ = number of correct answers, $X \sim B(10, 0.25)$. Apply the PMF:
$$ P(X = 4) = \binom{10}{4}\, (0.25)^{4}\, (0.75)^{6}. $$ $$ = 210 \cdot 0.003906 \cdot 0.177979 \approx 0.1460. $$So there is about a $14.6\%$ chance of guessing exactly $4$ correct out of $10$. Why this works: the guesses are independent, each is right with the same probability $0.25$, and $\binom{10}{4}$ counts the positions of the $4$ correct answers.
题目:一份测验有 $10$ 道选择题,每题 $4$ 个选项。学生全部凭猜作答。求恰好答对 $4$ 题的概率。
设 $X$ = 答对题数,则 $X \sim B(10, 0.25)$。代入概率质量函数(probability mass function / PMF):
所以纯靠猜测在 $10$ 题中恰好做对 $4$ 题的概率约为 $14.6\%$。原理:各题的猜测相互独立,每题答对的概率都是 $0.25$,而 $\binom{10}{4}$ 统计 $4$ 道答对的题可能出现在哪些位置。
Worked Example: Tail probability and GDC routing例题:尾部概率与 GDC 路径
Problem: $X \sim B(20, 0.3)$. Find (a) $P(X \le 5)$, (b) $P(X > 8)$, (c) $E(X)$ and $\text{Var}(X)$.
(a) Direct GDC: binomCdf(20, 0.3, 5).
(b) Use complement to fit "$\le$" into the GDC:
$$ P(X > 8) = 1 - P(X \le 8) = 1 - \text{binomCdf}(20, 0.3, 8) \approx 1 - 0.8867 = 0.1133. $$(c) Mean and variance directly from the formulas:
$$ E(X) = 20 \cdot 0.3 = 6, \qquad \text{Var}(X) = 20 \cdot 0.3 \cdot 0.7 = 4.2. $$题目:$X \sim B(20, 0.3)$。求 (a) $P(X \le 5)$,(b) $P(X > 8)$,(c) $E(X)$ 与 $\text{Var}(X)$。
(a) 直接用 GDC:binomCdf(20, 0.3, 5)。
(b) 用补集把"$>$"转换成 GDC 接受的"$\le$":
$$ P(X > 8) = 1 - P(X \le 8) = 1 - \text{binomCdf}(20, 0.3, 8) \approx 1 - 0.8867 = 0.1133. $$(c) 均值与方差直接代公式:
$$ E(X) = 20 \cdot 0.3 = 6, \qquad \text{Var}(X) = 20 \cdot 0.3 \cdot 0.7 = 4.2. $$off-by-one)错误。动计算器之前,先把题目改写成"$\le$"的形式。
Open every binomial answer with a definition in words and the model: "Let $X$ be the number of faulty bulbs in the sample; $X \sim B(20, 0.05)$." Then write the probability statement you want, such as $P(X \ge 3) = 1 - P(X \le 2)$, before any number. Calculator syntax such as binomCdf(20, 0.05, 2) is not mathematical working: write the probability in notation. Paper 1 allows no technology, so be ready to evaluate $\binom{n}{k}p^{k}(1-p)^{n-k}$ by hand for small $n$.
每道二项分布题都先用文字定义变量并写出模型:"设 $X$ 为样本中次品灯泡的个数;$X \sim B(20, 0.05)$。"在写任何数字之前,先写出所求的概率表达式,例如 $P(X \ge 3) = 1 - P(X \le 2)$。binomCdf(20, 0.05, 2) 之类的计算器语法不是数学过程:要用数学记号写出概率。Paper 1 不允许使用技术工具,所以 $n$ 较小时要能手算 $\binom{n}{k}p^{k}(1-p)^{n-k}$。
$3$ cards are drawn without replacement from a standard pack of $52$ and $X$ is the number of hearts. Explain why $X$ is not binomial.从一副 $52$ 张的标准扑克牌中不放回地抽 $3$ 张,$X$ 为红桃张数。解释为什么 $X$ 不服从二项分布。
The draws are not independent. The first card is a heart with probability $\tfrac{13}{52}$, but if it was a heart the second is a heart with probability $\tfrac{12}{51}$, and otherwise $\tfrac{13}{51}$. The success probability depends on earlier results, so condition (4) fails.
各次抽取不独立。第一张是红桃的概率为 $\tfrac{13}{52}$;但若第一张是红桃,第二张是红桃的概率为 $\tfrac{12}{51}$,否则为 $\tfrac{13}{51}$。成功概率依赖于前面的结果,所以条件 (4) 不成立。
$X \sim B(5, 0.2)$. Find $P(X = 2)$ exactly.$X \sim B(5, 0.2)$。求 $P(X = 2)$ 的精确值。
$P(X = 2) = \binom{5}{2}(0.2)^{2}(0.8)^{3} = 10 \times 0.04 \times 0.512 = 0.2048$.
$P(X = 2) = \binom{5}{2}(0.2)^{2}(0.8)^{3} = 10 \times 0.04 \times 0.512 = 0.2048$。
A fair coin is tossed $8$ times. Find the probability of at least one head.均匀硬币抛 $8$ 次。求至少出现一次正面的概率。
$X \sim B(8, 0.5)$. $P(X \ge 1) = 1 - P(X = 0) = 1 - (0.5)^{8} = 1 - \tfrac{1}{256} = \tfrac{255}{256} \approx 0.996$.
$X \sim B(8, 0.5)$。$P(X \ge 1) = 1 - P(X = 0) = 1 - (0.5)^{8} = 1 - \tfrac{1}{256} = \tfrac{255}{256} \approx 0.996$。
$X \sim B(n, p)$ with $E(X) = 6$ and $\text{Var}(X) = 4.2$. Find $n$ and $p$.$X \sim B(n, p)$,$E(X) = 6$,$\text{Var}(X) = 4.2$。求 $n$ 与 $p$。
Divide: $\dfrac{np(1-p)}{np} = 1 - p = \dfrac{4.2}{6} = 0.7$, so $p = 0.3$ and $n = \dfrac{6}{0.3} = 20$. This is the $B(20, 0.3)$ of the worked example above.
两式相除:$\dfrac{np(1-p)}{np} = 1 - p = \dfrac{4.2}{6} = 0.7$,故 $p = 0.3$,$n = \dfrac{6}{0.3} = 20$。这正是上面例题中的 $B(20, 0.3)$。
3.5 Normal Distribution: Properties and Calculations3.5 正态分布:性质与计算 SL 4.9
- State the properties of $X \sim N(\mu, \sigma^{2})$: symmetry about $\mu$, mean = median = mode, total area $1$.
- Use the $68$-$95$-$99.7$ rule to estimate probabilities within $1$, $2$ or $3$ standard deviations of the mean.
- Use symmetry to find probabilities such as $P(X < \mu - a)$ from $P(X > \mu + a)$.
- Calculate normal probabilities with technology, entering $\sigma$ rather than $\sigma^{2}$.
- Sketch a normal curve and shade the region that matches a probability statement.
- 写出(
state)$X \sim N(\mu, \sigma^{2})$ 的性质:关于 $\mu$ 对称,均值 = 中位数 = 众数,总面积为 $1$。 - 用 $68$-$95$-$99.7$ 法则估计(
estimate)距均值 $1$、$2$、$3$ 个标准差以内的概率。 - 利用对称性由 $P(X > \mu + a)$ 求出 $P(X < \mu - a)$ 等概率。
- 用技术工具计算(
calculate)正态概率,输入的是 $\sigma$ 而不是 $\sigma^{2}$。 - 画出(
sketch)正态曲线,并标出与概率表达式对应的阴影区域。
normCdf(a, b, μ, σ). It takes $\sigma$, not $\sigma^{2}$.
empirical rule):
$$ P(\mu - \sigma \le X \le \mu + \sigma) \approx 0.68, $$
$$ P(\mu - 2\sigma \le X \le \mu + 2\sigma) \approx 0.95, $$
$$ P(\mu - 3\sigma \le X \le \mu + 3\sigma) \approx 0.997. $$
使用技术工具时,正态概率由正态累积分布函数(如 normCdf(a, b, μ, σ))给出。输入的是 $\sigma$,不是 $\sigma^{2}$。
The curve's equation, for reference (normal probabilities are found with technology or the empirical rule, not by integrating this by hand):
曲线方程,仅供参考(正态概率用技术工具或经验法则求得,而不是手算这个式子的积分):
$$ f(x) = \frac{1}{\sigma\sqrt{2\pi}}\, \exp\!\left(-\frac{(x - \mu)^{2}}{2\sigma^{2}}\right) $$For probabilities, use a GDC. Mean $= $ median $= $ mode $= \mu$. Variance $= \sigma^{2}$. Because $X$ is continuous, $P(X = a) = 0$, so $P(X < a) = P(X \le a)$: including or excluding an endpoint makes no difference (unlike the binomial).
求概率请用 GDC。均值 $= $ 中位数 $= $ 众数 $= \mu$,方差 $= \sigma^{2}$。由于 $X$ 是连续变量,$P(X = a) = 0$,所以 $P(X < a) = P(X \le a)$:端点包含与否没有区别(这一点与二项分布不同)。
empirical rule)的 $68\%$、$95\%$ 与 $99.7\%$;约 $0.3\%$ 位于 $\mu \pm 3\sigma$ 之外。- Symmetric about $x = \mu$: $P(X < \mu) = P(X > \mu) = 0.5$.
- Bell-shaped: single peak at $x = \mu$.
- Mean = median = mode = $\mu$.
- Points of inflection at $x = \mu \pm \sigma$: the curve is concave down between them and concave up outside them.
- Total area under the curve is $1$. The curve never touches the $x$-axis, but only about $0.3\%$ of the area lies beyond $\mu \pm 3\sigma$.
- 关于 $x = \mu$ 对称:$P(X < \mu) = P(X > \mu) = 0.5$。
- 呈钟形:在 $x = \mu$ 处取唯一最大值。
- 均值 = 中位数 = 众数 = $\mu$。
- 拐点(
points of inflection)位于 $x = \mu \pm \sigma$:两拐点之间曲线向下凹,之外向上凹。 - 曲线下方总面积为 $1$。曲线永不触及 $x$ 轴,但 $\mu \pm 3\sigma$ 之外的面积只有约 $0.3\%$。
Worked Example: Probability between two values例题:区间概率
Problem: The heights of adult women in a city are normally distributed with $\mu = 165$ cm and $\sigma = 7$ cm. Find the probability that a randomly chosen woman is between $158$ cm and $172$ cm tall.
$158 = \mu - \sigma$ and $172 = \mu + \sigma$. By the empirical rule:
$$ P(158 \le X \le 172) = P(\mu - \sigma \le X \le \mu + \sigma) \approx 0.68. $$Via GDC: normCdf(158, 172, 165, 7) $\approx 0.6827$. Why this works: both limits are exactly one standard deviation from the mean, so the empirical rule applies directly; technology gives the unrounded value.
题目:某城市成年女性身高服从正态分布,$\mu = 165$ cm,$\sigma = 7$ cm。求随机抽取一位女性身高在 $158$ cm 到 $172$ cm 之间的概率。
$158 = \mu - \sigma$,$172 = \mu + \sigma$。由经验法则:
$$ P(158 \le X \le 172) = P(\mu - \sigma \le X \le \mu + \sigma) \approx 0.68. $$用 GDC:normCdf(158, 172, 165, 7) $\approx 0.6827$。原理:两个端点都恰好距均值一个标准差,所以可直接用经验法则;技术工具给出未取整的值。
Worked Example: Tail probability例题:尾部概率
Problem: Same setup ($\mu = 165$, $\sigma = 7$). Find $P(X > 180)$.
Use GDC. The upper tail goes to $\infty$, which we represent with a number far above the mean, such as $1\,000$, on the calculator:
$$ P(X > 180) = \text{normCdf}(180, 1000, 165, 7) \approx 0.0161. $$So about $1.6\%$ of adult women are taller than $180$ cm in this city.
题目:沿用上题($\mu = 165$,$\sigma = 7$)。求 $P(X > 180)$。
用 GDC。上尾延伸到 $\infty$,计算器里用一个远大于均值的数(例如 $1\,000$)代替:
$$ P(X > 180) = \text{normCdf}(180, 1000, 165, 7) \approx 0.0161. $$所以这座城市约有 $1.6\%$ 的成年女性高于 $180$ cm。
Worked Example: Probability of a deviation例题:偏差概率
Problem: $X \sim N(50, 64)$ (so $\sigma = 8$). Find $P(|X - 50| < 12)$.
$|X - 50| < 12 \Leftrightarrow 38 < X < 62$. So we want $P(38 < X < 62)$:
$$ P(38 \le X \le 62) = \text{normCdf}(38, 62, 50, 8) \approx 0.8664. $$Equivalently, $|Z| < 1.5$ in standardized form (see 3.6). Strict or weak inequalities give the same answer because $X$ is continuous.
题目:$X \sim N(50, 64)$(即 $\sigma = 8$)。求 $P(|X - 50| < 12)$。
$|X - 50| < 12 \Leftrightarrow 38 < X < 62$。所以要求的就是 $P(38 < X < 62)$:
$$ P(38 \le X \le 62) = \text{normCdf}(38, 62, 50, 8) \approx 0.8664. $$等价地,在标准化后表示为 $|Z| < 1.5$(见 3.6 节)。由于 $X$ 是连续变量,用严格或非严格不等号结果相同。
▸ Going deeper: Why are so many real distributions approximately normal?▸ 深入:为何现实中那么多分布近似正态?
The Central Limit Theorem says: if $X_{1}, X_{2}, \ldots, X_{n}$ are independent, identically distributed RVs with finite mean and variance, then for large $n$ their sum (and hence their mean) is approximately normal, whatever the distribution of the individual $X_{i}$.
This is why quantities such as heights and measurement errors are often close to bell-shaped: each is the combined effect of many small, roughly independent contributions. You do not need the CLT for the calculations in this unit, but it explains why the normal distribution is such a common model.
中心极限定理(central limit theorem)告诉我们:若 $X_{1}, X_{2}, \ldots, X_{n}$ 是独立同分布(independent and identically distributed)、均值和方差都有限的随机变量,那么当 $n$ 足够大时,它们的和(以及均值)近似服从正态分布,无论单个 $X_{i}$ 本身是什么分布。
这就是为什么身高、测量误差这类量常常接近钟形:每一个都是许多小而近似独立的因素共同作用的结果。本单元的计算不需要用到 CLT,但它解释了为什么正态分布是如此常用的模型。
normCdf(40, 70, 50, 10) $\approx 0.8186$.)正确!标准化:$z_{1} = -1$,$z_{2} = 2$。$P = \Phi(2) - \Phi(-1) \approx 0.9772 - 0.1587 = 0.8185$。(GDC:normCdf(40, 70, 50, 10) $\approx 0.8186$。)normCdf(40, 70, 50, 10) $\approx 0.8186$.$40 = \mu - \sigma$,$70 = \mu + 2\sigma$,所求是 $-1\sigma$ 到 $+2\sigma$ 之间的面积。由对称性约为 $\tfrac{1}{2}(0.68) + \tfrac{1}{2}(0.95) \approx 0.815$;或用 GDC normCdf(40, 70, 50, 10) $\approx 0.8186$。Before using technology, sketch the bell curve, mark $\mu$ and the given values, and shade the region you need; the sketch shows at once whether the answer should be more or less than $0.5$. Write the probability statement in notation, for example $P(X > 180) \approx 0.0161$, rather than calculator syntax alone. When the limits are whole numbers of standard deviations from the mean, the $68$-$95$-$99.7$ rule and symmetry give the answer without technology, which matters on Paper 1 (no technology).
用技术工具之前,先画出钟形曲线,标出 $\mu$ 与题中给出的值,并把所需区域涂上阴影;草图能立刻告诉你答案应大于还是小于 $0.5$。用数学记号写出概率表达式,例如 $P(X > 180) \approx 0.0161$,而不是只写计算器语法。当端点距均值恰好为整数个标准差时,用 $68$-$95$-$99.7$ 法则和对称性就能不借助技术工具得出答案,这在 Paper 1(不允许使用技术工具)中很重要。
$X \sim N(30, 16)$. Without technology, estimate $P(26 < X < 34)$.$X \sim N(30, 16)$。不用技术工具,估计 $P(26 < X < 34)$。
$\sigma = \sqrt{16} = 4$, so $26$ and $34$ are $\mu \mp \sigma$. By the empirical rule, $P(26 < X < 34) \approx 0.68$. (Note $16$ is the variance, not the standard deviation.)
$\sigma = \sqrt{16} = 4$,所以 $26$ 与 $34$ 正是 $\mu \mp \sigma$。由经验法则,$P(26 < X < 34) \approx 0.68$。(注意 $16$ 是方差,不是标准差。)
$X \sim N(\mu, \sigma^{2})$ and $P(X > \mu + 5) = 0.12$. Find $P(\mu - 5 < X < \mu + 5)$.$X \sim N(\mu, \sigma^{2})$,且 $P(X > \mu + 5) = 0.12$。求 $P(\mu - 5 < X < \mu + 5)$。
By symmetry about $\mu$, $P(X < \mu - 5) = 0.12$ as well. So $P(\mu - 5 < X < \mu + 5) = 1 - 0.12 - 0.12 = 0.76$.
由关于 $\mu$ 的对称性,$P(X < \mu - 5) = 0.12$。所以 $P(\mu - 5 < X < \mu + 5) = 1 - 0.12 - 0.12 = 0.76$。
Masses of apples are $N(150, 12^{2})$ in grams. Find the probability that an apple weighs less than $135$ g, and the expected number of such apples in a crate of $200$.苹果质量(克)服从 $N(150, 12^{2})$。求一个苹果质量小于 $135$ g 的概率,以及一箱 $200$ 个苹果中这类苹果的期望个数。
$P(X < 135) = \text{normCdf}(-1000, 135, 150, 12) \approx 0.106$ (here $z = -1.25$). Expected number $= 200 \times 0.1056 \approx 21.1$, about $21$ apples.
$P(X < 135) = \text{normCdf}(-1000, 135, 150, 12) \approx 0.106$(此处 $z = -1.25$)。期望个数 $= 200 \times 0.1056 \approx 21.1$,约 $21$ 个。
Explain why, for a normal variable, $P(X \le 40) = P(X < 40)$, but for $X \sim B(50, 0.8)$ these can differ.解释为什么正态变量满足 $P(X \le 40) = P(X < 40)$,而对 $X \sim B(50, 0.8)$ 两者可能不同。
A normal variable is continuous, so the probability of any single value is $0$ and the endpoint adds nothing. A binomial variable is discrete: $P(X \le 40) = P(X < 40) + P(X = 40)$, and $P(X = 40) > 0$.
正态变量是连续的,任一单点的概率为 $0$,端点不增加概率。二项变量是离散的:$P(X \le 40) = P(X < 40) + P(X = 40)$,而 $P(X = 40) > 0$。
3.6 Inverse Normal & Standardization3.6 反正态与标准化 SL 4.9 / 4.12
- Calculate a $z$-score $z = (x - \mu)/\sigma$ and interpret it as a number of standard deviations from the mean.
- Use the inverse normal to find $x$ such that $P(X \le x) = p$, including percentiles.
- Rewrite "greater than" and "middle" conditions as $P(X \le x) = p$ before using the inverse normal.
- Find an unknown $\mu$ or $\sigma$ from a given probability by standardizing.
- Solve simultaneous equations to find both $\mu$ and $\sigma$ from two probabilities.
- 计算(
calculate)$z$ 分数 $z = (x - \mu)/\sigma$,并把它解释为距均值的标准差个数。 - 用反正态(
inverse normal)求满足 $P(X \le x) = p$ 的 $x$,包括百分位数。 - 使用反正态之前,把"大于"和"居中"条件改写成 $P(X \le x) = p$。
- 通过标准化,由给定概率求出(
find)未知的 $\mu$ 或 $\sigma$。 - 解联立方程,由两个概率同时求出 $\mu$ 与 $\sigma$。
invNorm(p, μ, σ). For percentile questions, set $p$ equal to the percentile written as a decimal. Always sketch the curve and shade the area you want: it is easy to use the wrong tail.
standardization)把任意正态随机变量转换为 $Z \sim N(0, 1)$:
$$ Z = \frac{X - \mu}{\sigma}, \qquad X = \mu + Z\sigma. $$
反正态(inverse normal)走相反方向:给定概率 $p$,求满足 $P(X \le x) = p$ 的值 $x$。GDC 上的命令是 invNorm(p, μ, σ)。求百分位数时,把 $p$ 设为对应百分位(写成小数)。务必先画出正态曲线并标出所求区域:很容易用错一侧的尾部。
The standard normal $Z \sim N(0, 1)$ has $\mu = 0$ and $\sigma = 1$. Any normal probability can be rewritten in terms of $Z$.
标准正态分布 $Z \sim N(0, 1)$ 满足 $\mu = 0$、$\sigma = 1$。任何正态概率都可改写为关于 $Z$ 的形式。
normCdf or invNorm directly. Standardization is required when $\mu$ or $\sigma$ is unknown: find $z$ from the standard normal with invNorm, then solve $z = (x - \mu)/\sigma$ for the unknown. It is also how you compare values from different normal distributions (a larger $z$ is relatively higher).
$\mu$ 与 $\sigma$ 都已知时,技术工具不需要 $z$:直接把 $\mu$、$\sigma$ 输入 normCdf 或 invNorm。当 $\mu$ 或 $\sigma$ 未知时必须标准化:先在标准正态上用 invNorm 求出 $z$,再由 $z = (x - \mu)/\sigma$ 解出未知量。比较来自不同正态分布的数值时也要用标准化(z-score):$z$ 越大,相对位置越高。
Worked Example: Standard $z$-scores例题:标准 $z$ 分数
Problem: $X \sim N(72, 64)$ ($\sigma = 8$). Convert $X = 80$ and $X = 60$ to $z$-scores.
$$ z_{80} = \frac{80 - 72}{8} = 1, \qquad z_{60} = \frac{60 - 72}{8} = -1.5. $$So $X = 80$ is $1$ standard deviation above the mean; $X = 60$ is $1.5$ SDs below. Why this works: dividing the distance from the mean by $\sigma$ measures it in standard deviations, which is what $Z \sim N(0, 1)$ counts.
题目:$X \sim N(72, 64)$($\sigma = 8$)。把 $X = 80$ 与 $X = 60$ 转换为 $z$ 分数(z-score)。
所以 $X = 80$ 在均值之上 $1$ 个标准差;$X = 60$ 在均值之下 $1.5$ 个标准差。原理:把到均值的距离除以 $\sigma$,就是以标准差为单位度量距离,这正是 $Z \sim N(0, 1)$ 所计的量。
Worked Example: Inverse normal (percentile)例题:反正态(百分位数)
Problem: IQ scores are normally distributed with $\mu = 100$, $\sigma = 15$. Find the IQ that corresponds to the $95$th percentile.
The $95$th percentile is the value $x$ with $P(X \le x) = 0.95$. GDC: invNorm(0.95, 100, 15).
So an IQ of about $125$ marks the top $5\%$.
题目:智商分数服从正态分布,$\mu = 100$,$\sigma = 15$。求第 $95$ 百分位对应的智商。
第 $95$ 百分位即满足 $P(X \le x) = 0.95$ 的值 $x$。GDC:invNorm(0.95, 100, 15)。
所以智商约 $125$ 即可进入前 $5\%$。
Worked Example: Find $\mu$ given a probability例题:已知概率反求 $\mu$
Problem: The lifetime $X$ of a lightbulb is normally distributed with unknown mean $\mu$ and known SD $\sigma = 200$ hours. It is known that $5\%$ of bulbs fail before $1\,500$ hours. Find $\mu$.
We are told $P(X < 1500) = 0.05$, so $1\,500$ corresponds to the $5$th percentile. Use invNorm on $Z$:
$$ z_{0.05} = \text{invNorm}(0.05, 0, 1) \approx -1.6449. $$Now apply $z = (x - \mu)/\sigma$:
$$ -1.6449 = \frac{1500 - \mu}{200} \;\Longrightarrow\; \mu = 1500 + 1.6449 \cdot 200 \approx 1829.0. $$So the mean lifetime is about $1\,829$ hours. Check: $1\,500$ is below the mean, as it must be for a $5\%$ lower tail.
题目:灯泡寿命 $X$ 服从正态分布,均值 $\mu$ 未知,标准差 $\sigma = 200$ 小时已知。已知 $5\%$ 的灯泡寿命不足 $1\,500$ 小时。求 $\mu$。
由题 $P(X < 1500) = 0.05$,即 $1\,500$ 是第 $5$ 百分位。先对 $Z$ 用 invNorm:
$$ z_{0.05} = \text{invNorm}(0.05, 0, 1) \approx -1.6449. $$再代入 $z = (x - \mu)/\sigma$:
$$ -1.6449 = \frac{1500 - \mu}{200} \;\Longrightarrow\; \mu = 1500 + 1.6449 \cdot 200 \approx 1829.0. $$所以平均寿命约为 $1\,829$ 小时。验算:$1\,500$ 在均值下方,符合 $5\%$ 下尾的要求。
Worked Example: Find $\sigma$ given a probability例题:已知概率反求 $\sigma$
Problem: $X \sim N(50, \sigma^{2})$ and $P(X > 65) = 0.10$. Find $\sigma$.
$P(X > 65) = 0.10 \Rightarrow P(X \le 65) = 0.90$. The corresponding $z$:
$$ z_{0.90} = \text{invNorm}(0.90, 0, 1) \approx 1.2816. $$Apply $z = (65 - 50)/\sigma$:
$$ 1.2816 = \frac{15}{\sigma} \;\Longrightarrow\; \sigma = \frac{15}{1.2816} \approx 11.70. $$题目:$X \sim N(50, \sigma^{2})$,且 $P(X > 65) = 0.10$。求 $\sigma$。
$P(X > 65) = 0.10 \Rightarrow P(X \le 65) = 0.90$,对应的 $z$:
$$ z_{0.90} = \text{invNorm}(0.90, 0, 1) \approx 1.2816. $$代入 $z = (65 - 50)/\sigma$:
$$ 1.2816 = \frac{15}{\sigma} \;\Longrightarrow\; \sigma = \frac{15}{1.2816} \approx 11.70. $$invNorm(p, μ, σ) always returns the value $x$ with $P(X \le x) = p$. If a problem says "$10\%$ of bulbs last more than $X$," then $p = 0.90$ in invNorm, not $0.10$. Always rephrase the question as $P(X \le x) = p$ first.
GDC 的 invNorm(p, μ, σ) 始终返回满足 $P(X \le x) = p$ 的 $x$。若题目说"$10\%$ 的灯泡寿命大于 $X$",则代入 invNorm 时 $p = 0.90$,而不是 $0.10$。动手前先把题目改写成 $P(X \le x) = p$ 的形式。
For an unknown $\mu$ or $\sigma$, write the standardized equation in full, for example $\dfrac{65 - 50}{\sigma} = 1.2816$, and keep at least $4$ significant figures in $z$ until the final answer, since rounding $z$ early shifts the result. With two unknowns, write one equation from each probability and solve them simultaneously. Finally, check direction: a value with less than $50\%$ of the distribution below it must lie below the mean, so its $z$ is negative.
求未知的 $\mu$ 或 $\sigma$ 时,完整写出标准化方程,例如 $\dfrac{65 - 50}{\sigma} = 1.2816$,并且在得到最终答案前,$z$ 至少保留 $4$ 位有效数字,因为过早取整 $z$ 会让结果偏移。两个未知数时,每个概率列一个方程,联立求解。最后检查方向:低于该值的比例不到 $50\%$ 的数一定在均值下方,其 $z$ 为负。
A student scores $78$ in a test that is $N(70, 5^{2})$ and $81$ in a test that is $N(75, 4^{2})$. In which test did the student do relatively better?某学生在 $N(70, 5^{2})$ 的考试中得 $78$ 分,在 $N(75, 4^{2})$ 的考试中得 $81$ 分。哪次考试相对表现更好?
$z_{1} = \tfrac{78 - 70}{5} = 1.6$ and $z_{2} = \tfrac{81 - 75}{4} = 1.5$. The first test: the score is more standard deviations above its mean.
$z_{1} = \tfrac{78 - 70}{5} = 1.6$,$z_{2} = \tfrac{81 - 75}{4} = 1.5$。第一次考试更好:该分数高出均值的标准差个数更多。
$X \sim N(200, 15^{2})$. Find the value $a$ such that $P(X > a) = 0.25$.$X \sim N(200, 15^{2})$。求满足 $P(X > a) = 0.25$ 的 $a$。
Rewrite as $P(X \le a) = 0.75$. $a = \text{invNorm}(0.75, 200, 15) = 200 + 0.6745 \times 15 \approx 210.1$.
改写为 $P(X \le a) = 0.75$。$a = \text{invNorm}(0.75, 200, 15) = 200 + 0.6745 \times 15 \approx 210.1$。
$X \sim N(60, 8^{2})$. Find the interval, symmetric about the mean, that contains the middle $90\%$ of the distribution.$X \sim N(60, 8^{2})$。求关于均值对称、包含分布中间 $90\%$ 的区间。
$5\%$ lies in each tail, so the upper limit has $P(X \le x) = 0.95$: $z = 1.6449$, $x = 60 + 1.6449 \times 8 \approx 73.2$. By symmetry the lower limit is $60 - 13.16 \approx 46.8$. Interval: $46.8 < X < 73.2$.
两侧尾部各 $5\%$,所以上端点满足 $P(X \le x) = 0.95$:$z = 1.6449$,$x = 60 + 1.6449 \times 8 \approx 73.2$。由对称性,下端点为 $60 - 13.16 \approx 46.8$。区间:$46.8 < X < 73.2$。
$X \sim N(\mu, \sigma^{2})$ with $P(X < 20) = 0.1$ and $P(X > 50) = 0.2$. Find $\mu$ and $\sigma$.$X \sim N(\mu, \sigma^{2})$,$P(X < 20) = 0.1$,$P(X > 50) = 0.2$。求 $\mu$ 与 $\sigma$。
$\text{invNorm}(0.1) \approx -1.2816$ and $\text{invNorm}(0.8) \approx 0.8416$ give $\mu - 1.2816\sigma = 20$ and $\mu + 0.8416\sigma = 50$. Subtracting: $2.1232\sigma = 30$, so $\sigma \approx 14.13$ and $\mu = 20 + 1.2816 \times 14.13 \approx 38.1$.
$\text{invNorm}(0.1) \approx -1.2816$,$\text{invNorm}(0.8) \approx 0.8416$,得 $\mu - 1.2816\sigma = 20$ 与 $\mu + 0.8416\sigma = 50$。相减:$2.1232\sigma = 30$,故 $\sigma \approx 14.13$,$\mu = 20 + 1.2816 \times 14.13 \approx 38.1$。
3.7 Continuous Random Variables and PDFs3.7 连续随机变量与 PDF AHL 4.14 HL
- State the two conditions for $f(x)$ to be a probability density function.
- Find an unknown constant in a PDF by setting the total integral equal to $1$.
- Calculate $P(a \le X \le b)$, $E(X)$, $E(X^{2})$ and $\text{Var}(X)$ by integration.
- Find the median by solving $\int_{-\infty}^{m} f(x)\,dx = \tfrac{1}{2}$ and the mode as the maximum of $f$.
- Explain why $P(X = a) = 0$ for a continuous random variable.
- 写出(
state)$f(x)$ 成为概率密度函数的两个条件。 - 令总积分等于 $1$,求出(
find)PDF 中的未知常数。 - 用积分计算(
calculate)$P(a \le X \le b)$、$E(X)$、$E(X^{2})$ 与 $\text{Var}(X)$。 - 解 $\int_{-\infty}^{m} f(x)\,dx = \tfrac{1}{2}$ 求中位数,并把众数求为 $f$ 的最大值点。
- 解释(
explain)为什么连续随机变量满足 $P(X = a) = 0$。
continuous random variable)$X$ 具有概率密度函数(probability density function / PDF)$f(x)$,满足 $f(x) \ge 0$ 且 $\int_{-\infty}^{\infty} f(x)\, dx = 1$。概率就是 PDF 曲线下方的面积:
$$ P(a \le X \le b) = \int_{a}^{b} f(x)\, dx. $$
均值、方差与中位数都用积分表达。最关键的一点:对任意单点 $a$,$P(X = a) = 0$:只有区间才可能具有正概率。所以连续随机变量满足 $P(a \le X \le b) = P(a < X < b)$(与离散情形不同)。
mode)就是使 $f(x)$ 取最大值的 $x$。做法是求导:在定义域上解 $f'(x) = 0$,再用 $f''$ 的符号(或检验端点值)判定极大点。正态分布的众数恰为 $\mu$,即钟形曲线的最高点。
Worked Example: Solve for the normalising constant例题:求归一化常数
Problem: $X$ has PDF $f(x) = c x$ for $0 \le x \le 4$ and $0$ elsewhere. Find $c$, then compute $E(X)$ and $\text{Var}(X)$.
Normalisation:
$$ \int_{0}^{4} c\, x\, dx = c \cdot \tfrac{x^{2}}{2}\Big|_{0}^{4} = 8c = 1 \;\Longrightarrow\; c = \tfrac{1}{8}. $$Mean:
$$ E(X) = \int_{0}^{4} x \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{4} = \tfrac{64}{24} = \tfrac{8}{3} \approx 2.667. $$$E(X^{2})$:
$$ E(X^{2}) = \int_{0}^{4} x^{2} \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{4}}{4}\Big|_{0}^{4} = \tfrac{256}{32} = 8. $$Variance:
$$ \text{Var}(X) = 8 - \left(\tfrac{8}{3}\right)^{2} = 8 - \tfrac{64}{9} = \tfrac{72 - 64}{9} = \tfrac{8}{9} \approx 0.889. $$Why this works: the integrals replace the sums of the discrete case, with $f(x)\,dx$ playing the role of $P(X = x_i)$.
题目:$X$ 的 PDF 为 $f(x) = c x$($0 \le x \le 4$),其余处取 $0$。求 $c$,并计算 $E(X)$ 与 $\text{Var}(X)$。
归一化:
$$ \int_{0}^{4} c\, x\, dx = c \cdot \tfrac{x^{2}}{2}\Big|_{0}^{4} = 8c = 1 \;\Longrightarrow\; c = \tfrac{1}{8}. $$均值:
$$ E(X) = \int_{0}^{4} x \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{4} = \tfrac{64}{24} = \tfrac{8}{3} \approx 2.667. $$$E(X^{2})$:
$$ E(X^{2}) = \int_{0}^{4} x^{2} \cdot \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{4}}{4}\Big|_{0}^{4} = \tfrac{256}{32} = 8. $$方差:
$$ \text{Var}(X) = 8 - \left(\tfrac{8}{3}\right)^{2} = 8 - \tfrac{64}{9} = \tfrac{72 - 64}{9} = \tfrac{8}{9} \approx 0.889. $$原理:积分取代了离散情形中的求和,$f(x)\,dx$ 的作用相当于 $P(X = x_i)$。
Worked Example: Probability over an interval例题:区间概率
Problem: Same $X$ with $f(x) = \tfrac{x}{8}$ on $[0, 4]$. Find $P(1 \le X \le 3)$.
$$ P(1 \le X \le 3) = \int_{1}^{3} \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{2}}{2}\Big|_{1}^{3} = \tfrac{1}{16}(9 - 1) = \tfrac{8}{16} = \tfrac{1}{2}. $$题目:沿用上题的 $X$,$f(x) = \tfrac{x}{8}$($x \in [0, 4]$)。求 $P(1 \le X \le 3)$。
$$ P(1 \le X \le 3) = \int_{1}^{3} \tfrac{x}{8}\, dx = \tfrac{1}{8} \cdot \tfrac{x^{2}}{2}\Big|_{1}^{3} = \tfrac{1}{16}(9 - 1) = \tfrac{8}{16} = \tfrac{1}{2}. $$Worked Example: Finding the median例题:求中位数
Problem: $X$ has PDF $f(x) = \tfrac{3}{8} x^{2}$ for $0 \le x \le 2$. Find the median $m$.
The median $m$ satisfies $\int_{0}^{m} f(x)\, dx = \tfrac{1}{2}$:
$$ \int_{0}^{m} \tfrac{3}{8} x^{2}\, dx = \tfrac{3}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{m} = \tfrac{m^{3}}{8} = \tfrac{1}{2}. $$ $$ m^{3} = 4 \;\Longrightarrow\; m = \sqrt[3]{4} \approx 1.587. $$Note: the median is not the midpoint of the interval $(= 1)$. This PDF increases on $[0, 2]$, so more of the probability lies in the right half, and the median is bigger than the midpoint.
题目:$X$ 的 PDF 为 $f(x) = \tfrac{3}{8} x^{2}$($0 \le x \le 2$)。求中位数(median)$m$。
中位数 $m$ 满足 $\int_{0}^{m} f(x)\, dx = \tfrac{1}{2}$:
$$ \int_{0}^{m} \tfrac{3}{8} x^{2}\, dx = \tfrac{3}{8} \cdot \tfrac{x^{3}}{3}\Big|_{0}^{m} = \tfrac{m^{3}}{8} = \tfrac{1}{2}. $$ $$ m^{3} = 4 \;\Longrightarrow\; m = \sqrt[3]{4} \approx 1.587. $$注意:中位数不是区间中点 $(= 1)$。这个 PDF 在 $[0, 2]$ 上递增,右半部分的概率更多,所以中位数比中点要大。
Worked Example: Finding the mode例题:求众数
Problem: $X$ has PDF $f(x) = 12 x^{2}(1 - x)$ for $0 \le x \le 1$. Find the mode.
Differentiate and set to zero:
$$ f'(x) = 12\!\left[2x(1 - x) - x^{2}\right] = 12 x (2 - 3 x). $$$f'(x) = 0$ at $x = 0$ or $x = \tfrac{2}{3}$. Both endpoints give $f(0) = f(1) = 0$; $f''(x) = 12(2 - 6x)$, so $f''\!\left(\tfrac{2}{3}\right) = -24 < 0$ confirms a maximum, with $f\!\left(\tfrac{2}{3}\right) = \tfrac{16}{9}$:
$$ \text{mode} = \tfrac{2}{3}. $$题目:$X$ 的 PDF 为 $f(x) = 12 x^{2}(1 - x)$($0 \le x \le 1$)。求众数。
求导并令其为零:
$$ f'(x) = 12\!\left[2x(1 - x) - x^{2}\right] = 12 x (2 - 3 x). $$$f'(x) = 0$ 在 $x = 0$ 或 $x = \tfrac{2}{3}$。两个端点处 $f(0) = f(1) = 0$;$f''(x) = 12(2 - 6x)$,所以 $f''\!\left(\tfrac{2}{3}\right) = -24 < 0$,确认是极大点,且 $f\!\left(\tfrac{2}{3}\right) = \tfrac{16}{9}$:
$$ \text{mode} = \tfrac{2}{3}. $$▸ Going deeper: Why $P(X = a) = 0$ for a continuous RV▸ 深入:为什么连续随机变量满足 $P(X = a) = 0$
For a continuous RV with PDF $f$, the probability of exactly $X = a$ is
$$ P(X = a) = \int_{a}^{a} f(x)\, dx = 0. $$This is not a quirk: it follows from measuring probability as area instead of point masses. A density assigns probability to intervals, and any single value has interval length $0$. Two consequences:
- For continuous RVs, $P(a \le X \le b) = P(a < X < b) = P(a < X \le b)$. Inequality endpoints don't matter.
- For discrete RVs, $P(X = a) > 0$ in general, and strict vs. weak inequalities do matter (Section 3.4's trap).
This is a key reason that the discrete and continuous "languages" are not interchangeable, even though the formulas look alike.
对于具有 PDF $f$ 的连续随机变量,恰好 $X = a$ 的概率是
$$ P(X = a) = \int_{a}^{a} f(x)\, dx = 0. $$这不是怪现象:它来自把概率定义成面积(而不是点质量)。密度只把概率分配给区间,而任何单点构成的区间长度为 $0$。两个推论:
- 对连续随机变量,$P(a \le X \le b) = P(a < X < b) = P(a < X \le b)$:端点的严格/非严格不等号无差别。
- 对离散随机变量,一般 $P(X = a) > 0$,严格不等号与非严格不等号必须区分(即 3.4 节里的陷阱)。
这是离散与连续两套"语言"形式相似却不能互换的一个关键原因。
Write every integral with its limits taken from the support of $f$, not from $-\infty$ to $\infty$: outside the support $f(x) = 0$ and contributes nothing. Keep the median and the mode apart: the median solves an integral equation equal to $\tfrac{1}{2}$, the mode maximises $f$ itself, and for the mode check the endpoints of the support as well as $f'(x) = 0$. When the median equation is a cubic or worse, solve it with technology and reject roots outside the support.
每个积分的上下限都取自 $f$ 的支撑区间(support),而不是从 $-\infty$ 到 $\infty$:支撑区间外 $f(x) = 0$,没有贡献。分清中位数与众数:中位数解的是等于 $\tfrac{1}{2}$ 的积分方程,众数是使 $f$ 本身最大的点;求众数时除了 $f'(x) = 0$,还要检查支撑区间的端点。若中位数方程是三次或更高次,用技术工具求解,并舍去支撑区间以外的根。
Is $f(x) = x - 1$ for $0 \le x \le 2$ (and $0$ elsewhere) a PDF? Give a reason.$f(x) = x - 1$($0 \le x \le 2$,其余处为 $0$)是 PDF 吗?说明理由。
No. Its integral is $\left[\tfrac{x^{2}}{2} - x\right]_{0}^{2} = 0$, not $1$, and $f(x) < 0$ for $0 \le x < 1$, which breaks $f(x) \ge 0$.
不是。它的积分为 $\left[\tfrac{x^{2}}{2} - x\right]_{0}^{2} = 0$,不等于 $1$;而且当 $0 \le x < 1$ 时 $f(x) < 0$,违反 $f(x) \ge 0$。
$f(x) = \tfrac{1}{4}$ for $2 \le x \le 6$. Find $E(X)$, $\text{Var}(X)$ and $P(X > 5)$.$f(x) = \tfrac{1}{4}$($2 \le x \le 6$)。求 $E(X)$、$\text{Var}(X)$ 与 $P(X > 5)$。
$E(X) = \int_{2}^{6} \tfrac{x}{4}\,dx = \tfrac{36 - 4}{8} = 4$. $E(X^{2}) = \int_{2}^{6} \tfrac{x^{2}}{4}\,dx = \tfrac{216 - 8}{12} = \tfrac{52}{3}$, so $\text{Var}(X) = \tfrac{52}{3} - 16 = \tfrac{4}{3}$. $P(X > 5) = \tfrac{6 - 5}{4} = 0.25$.
$E(X) = \int_{2}^{6} \tfrac{x}{4}\,dx = \tfrac{36 - 4}{8} = 4$。$E(X^{2}) = \int_{2}^{6} \tfrac{x^{2}}{4}\,dx = \tfrac{216 - 8}{12} = \tfrac{52}{3}$,故 $\text{Var}(X) = \tfrac{52}{3} - 16 = \tfrac{4}{3}$。$P(X > 5) = \tfrac{6 - 5}{4} = 0.25$。
$f(x) = \tfrac{x}{8}$ on $[0, 4]$ (the worked example above). Find the median.$f(x) = \tfrac{x}{8}$($[0, 4]$ 上,即上面的例题)。求中位数。
$\int_{0}^{m} \tfrac{x}{8}\,dx = \tfrac{m^{2}}{16} = \tfrac{1}{2}$, so $m^{2} = 8$ and $m = 2\sqrt{2} \approx 2.83$ (reject $-2\sqrt{2}$, outside the support).
$\int_{0}^{m} \tfrac{x}{8}\,dx = \tfrac{m^{2}}{16} = \tfrac{1}{2}$,故 $m^{2} = 8$,$m = 2\sqrt{2} \approx 2.83$(舍去支撑区间外的 $-2\sqrt{2}$)。
For $f(x) = \tfrac{x}{8}$ on $[0, 4]$, state the mode and explain why $f'(x) = 0$ does not find it.对 $f(x) = \tfrac{x}{8}$($[0, 4]$),写出众数,并解释为什么 $f'(x) = 0$ 找不到它。
$f'(x) = \tfrac{1}{8} > 0$, so $f$ is increasing and never has a stationary point. Its maximum on $[0, 4]$ is at the endpoint, so the mode is $x = 4$.
$f'(x) = \tfrac{1}{8} > 0$,$f$ 单调递增,没有驻点。它在 $[0, 4]$ 上的最大值在端点处取得,所以众数为 $x = 4$。
3.8 Linear Transformations and Sums of RVs3.8 线性变换与随机变量之和 AHL 4.14 HL
- Use $E(aX + b) = aE(X) + b$ and $\text{Var}(aX + b) = a^{2}\text{Var}(X)$.
- Show that $\text{Var}(aX + b) = a^{2}\,\text{Var}(X)$ from the definition of variance.
- Calculate the mean and variance of a sum or difference of independent random variables.
- State the distribution of a linear combination of independent normal variables.
- Distinguish the sum of $n$ independent copies $X_{1} + \cdots + X_{n}$ from the multiple $nX$.
- Calculate probabilities such as $P(X > Y)$ by rewriting them as $P(X - Y > 0)$.
- 使用 $E(aX + b) = aE(X) + b$ 与 $\text{Var}(aX + b) = a^{2}\text{Var}(X)$。
- 由方差的定义证明(
show that)$\text{Var}(aX + b) = a^{2}\,\text{Var}(X)$。 - 计算(
calculate)独立随机变量之和或差的均值与方差。 - 写出(
state)独立正态变量线性组合的分布。 - 区分(
distinguish)$n$ 个独立副本之和 $X_{1} + \cdots + X_{n}$ 与倍数 $nX$。 - 把 $P(X > Y)$ 改写为 $P(X - Y > 0)$ 后计算概率。
linear transformation):
$$ E(aX + b) = a\, E(X) + b, \qquad \text{Var}(aX + b) = a^{2}\, \text{Var}(X). $$
对任意随机变量 $X$、$Y$(无论是否独立):
$$ E(X \pm Y) = E(X) \pm E(Y). $$
仅当 $X$、$Y$ 独立时:
$$ \text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y). $$
独立正态分布的线性组合(linear combination)仍服从正态分布,新分布的均值与方差由上述规则给出。
$b$ shifts the centre but not the spread; $a$ scales both, and the variance by $a^{2}$. In words: Var(aX + b) is a² times Var(X), whatever the value of b, and the standard deviation is multiplied by |a|.
$b$ 只平移分布的中心,不改变离散程度;$a$ 同时缩放二者,而方差按 $a^{2}$ 缩放。用文字说:无论 b 取何值,Var(aX + b) 都等于 a² 乘以 Var(X),而标准差乘以 |a|。
The expectation rule holds without the independence assumption: linearity of expectation is unconditional. The variance rule requires independence.
期望规则不需要独立性假设:期望的线性性(linearity of expectation)无条件成立。方差规则则必须依赖独立性。
In particular, $X + Y \sim N(\mu_{1} + \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$ and $X - Y \sim N(\mu_{1} - \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$. Note the plus on the variances even for differences.
特别地,$X + Y \sim N(\mu_{1} + \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$,$X - Y \sim N(\mu_{1} - \mu_{2},\; \sigma_{1}^{2} + \sigma_{2}^{2})$。注意求差时方差仍是相加。
▸ Going deeper: Deriving $\text{Var}(aX + b) = a^{2}\,\text{Var}(X)$▸ 深入:推导 $\text{Var}(aX + b) = a^{2}\,\text{Var}(X)$
Let $Y = aX + b$. Apply linearity of expectation to compute the mean:
$$ E(Y) = E(aX + b) = a E(X) + b = a\mu + b. $$Now apply the definition of variance:
$$ \text{Var}(Y) = E\!\left[(Y - E(Y))^{2}\right] = E\!\left[(aX + b - a\mu - b)^{2}\right] = E\!\left[(a(X - \mu))^{2}\right]. $$Factor out the $a^{2}$ (which is a constant):
$$ = a^{2}\, E\!\left[(X - \mu)^{2}\right] = a^{2}\, \text{Var}(X). \;\;\blacksquare $$Two takeaways: the shift $b$ disappears (variance is translation-invariant: spread does not depend on where you measure from), and the scale factor $a$ enters squared (because squaring is what made variance non-negative in the first place). The fact that $|a|$ matters but $\text{sign}(a)$ doesn't is also a useful cross-check: $\text{Var}(-X) = \text{Var}(X)$.
设 $Y = aX + b$。用期望的线性性算出均值:
$$ E(Y) = E(aX + b) = a E(X) + b = a\mu + b. $$再代入方差的定义:
$$ \text{Var}(Y) = E\!\left[(Y - E(Y))^{2}\right] = E\!\left[(aX + b - a\mu - b)^{2}\right] = E\!\left[(a(X - \mu))^{2}\right]. $$把常数 $a^{2}$ 提到期望外面:
$$ = a^{2}\, E\!\left[(X - \mu)^{2}\right] = a^{2}\, \text{Var}(X). \;\;\blacksquare $$两点要记:常数项 $b$ 完全消失(方差具有平移不变性:离散程度与"从哪测量"无关);缩放因子 $a$ 进入时是平方(因为正是平方运算才让方差非负)。一个有用的交叉验证:只有 $|a|$ 重要、$\text{sign}(a)$ 无关紧要,即 $\text{Var}(-X) = \text{Var}(X)$。
▸ Going deeper: Why $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$ for independent RVs▸ 深入:为什么独立随机变量满足 $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$
Expand using the alternate variance formula and the fact that for independent RVs $E(XY) = E(X)E(Y)$ (a consequence of independence):
$$ \text{Var}(X + Y) = E\!\left[(X + Y)^{2}\right] - [E(X + Y)]^{2}. $$Expand the square inside the first expectation:
$$ = E(X^{2}) + 2 E(XY) + E(Y^{2}) - [E(X) + E(Y)]^{2}. $$Independence kicks in on $E(XY) = E(X)\, E(Y)$. The squared mean expands as $[E(X)]^{2} + 2 E(X) E(Y) + [E(Y)]^{2}$, so the $2 E(XY)$ and the $-2 E(X) E(Y)$ cancel exactly:
$$ = \!\left[E(X^{2}) - [E(X)]^{2}\right] + \!\left[E(Y^{2}) - [E(Y)]^{2}\right] = \text{Var}(X) + \text{Var}(Y). \;\;\blacksquare $$For $\text{Var}(X - Y)$, write $X - Y = X + (-Y)$ and use $\text{Var}(-Y) = (-1)^{2}\text{Var}(Y) = \text{Var}(Y)$, so variances still add. Variance always adds for independent RVs, even when the RVs are subtracted.
使用方差的另一种形式,并利用独立随机变量满足 $E(XY) = E(X)E(Y)$(这是独立性的一个推论):
$$ \text{Var}(X + Y) = E\!\left[(X + Y)^{2}\right] - [E(X + Y)]^{2}. $$展开第一项里的平方:
$$ = E(X^{2}) + 2 E(XY) + E(Y^{2}) - [E(X) + E(Y)]^{2}. $$独立性出现在 $E(XY) = E(X)\, E(Y)$。把均值的平方展开成 $[E(X)]^{2} + 2 E(X) E(Y) + [E(Y)]^{2}$,则 $2 E(XY)$ 与 $-2 E(X) E(Y)$ 恰好抵消:
$$ = \!\left[E(X^{2}) - [E(X)]^{2}\right] + \!\left[E(Y^{2}) - [E(Y)]^{2}\right] = \text{Var}(X) + \text{Var}(Y). \;\;\blacksquare $$对于 $\text{Var}(X - Y)$,写成 $X - Y = X + (-Y)$,再用 $\text{Var}(-Y) = (-1)^{2}\text{Var}(Y) = \text{Var}(Y)$,方差依然相加。独立随机变量的方差永远相加,即使两个变量是相减的。
Worked Example: Linear transformation例题:线性变换
Problem: $X$ has $E(X) = 10$ and $\text{Var}(X) = 4$. Let $Y = 3X - 5$. Find $E(Y)$ and $\text{Var}(Y)$.
$$ E(Y) = 3 \cdot 10 - 5 = 25, \qquad \text{Var}(Y) = 3^{2} \cdot 4 = 36. $$So $\sigma_{Y} = 6$ (three times $\sigma_{X} = 2$, since scale $a = 3$ multiplies SD by $|a|$). Why this works: the $-5$ moves every value by the same amount, so it changes the mean but not the spread.
题目:$X$ 满足 $E(X) = 10$、$\text{Var}(X) = 4$。设 $Y = 3X - 5$。求 $E(Y)$ 与 $\text{Var}(Y)$。
$$ E(Y) = 3 \cdot 10 - 5 = 25, \qquad \text{Var}(Y) = 3^{2} \cdot 4 = 36. $$所以 $\sigma_{Y} = 6$(恰为 $\sigma_{X} = 2$ 的三倍,因为缩放因子 $a = 3$ 把标准差乘以 $|a|$)。原理:$-5$ 让每个取值移动相同的量,所以它改变均值,但不改变离散程度。
Worked Example: Sum of independent RVs例题:独立随机变量之和
Problem: $X$ and $Y$ are independent with $E(X) = 5$, $\text{Var}(X) = 9$, $E(Y) = 3$, $\text{Var}(Y) = 16$. Find $E(2X - Y + 4)$ and $\text{Var}(2X - Y + 4)$.
$$ E(2X - Y + 4) = 2 \cdot 5 - 3 + 4 = 11. $$ $$ \text{Var}(2X - Y + 4) = 2^{2}\, \text{Var}(X) + (-1)^{2}\, \text{Var}(Y) = 4 \cdot 9 + 1 \cdot 16 = 52. $$The constant $+4$ shifts the mean but does not change the variance. The minus sign on $Y$ doesn't change its variance contribution either: variances always add for independent RVs.
题目:$X$、$Y$ 独立,且 $E(X) = 5$、$\text{Var}(X) = 9$、$E(Y) = 3$、$\text{Var}(Y) = 16$。求 $E(2X - Y + 4)$ 与 $\text{Var}(2X - Y + 4)$。
$$ E(2X - Y + 4) = 2 \cdot 5 - 3 + 4 = 11. $$ $$ \text{Var}(2X - Y + 4) = 2^{2}\, \text{Var}(X) + (-1)^{2}\, \text{Var}(Y) = 4 \cdot 9 + 1 \cdot 16 = 52. $$常数项 $+4$ 平移均值,但不改变方差。$Y$ 前的负号也不影响其对方差的贡献:独立随机变量的方差始终相加。
Worked Example: Sum of independent normals例题:独立正态之和
Problem: $X \sim N(20, 4)$ and $Y \sim N(15, 9)$ are independent. Find $P(X + Y > 40)$ and $P(X > Y)$.
A sum of independent normals is normal, so $X + Y \sim N(20 + 15,\; 4 + 9) = N(35, 13)$ and $\sigma = \sqrt{13} \approx 3.606$.
$$ P(X + Y > 40) = \text{normCdf}(40, 1000, 35, \sqrt{13}) \approx 0.0828. $$For $P(X > Y)$, rewrite as $P(X - Y > 0)$. Then $X - Y \sim N(20 - 15,\; 4 + 9) = N(5, 13)$; note the plus on the variances:
$$ P(X - Y > 0) = \text{normCdf}(0, 1000, 5, \sqrt{13}) \approx 0.9172. $$题目:$X \sim N(20, 4)$,$Y \sim N(15, 9)$,相互独立。求 $P(X + Y > 40)$ 与 $P(X > Y)$。
独立正态之和仍为正态,所以 $X + Y \sim N(20 + 15,\; 4 + 9) = N(35, 13)$,$\sigma = \sqrt{13} \approx 3.606$。
$$ P(X + Y > 40) = \text{normCdf}(40, 1000, 35, \sqrt{13}) \approx 0.0828. $$对 $P(X > Y)$,改写为 $P(X - Y > 0)$。则 $X - Y \sim N(20 - 15,\; 4 + 9) = N(5, 13)$;注意方差仍取加号:
$$ P(X - Y > 0) = \text{normCdf}(0, 1000, 5, \sqrt{13}) \approx 0.9172. $$Worked Example: Mean of $n$ independent normals例题:$n$ 个独立正态的均值
Problem: A factory weighs apples. Individual weights $X_{i} \sim N(150, 100)$ (so $\sigma = 10$ g) and weights are independent. A box contains $9$ apples. Find the distribution of the sample mean $\bar{X} = \tfrac{1}{9}\sum_{i=1}^{9} X_{i}$ and compute $P(\bar{X} > 154)$.
By the linear-combination rule with $a_{i} = \tfrac{1}{9}$ for each of $9$ terms:
$$ E(\bar{X}) = \tfrac{1}{9} \cdot 9 \cdot 150 = 150. $$ $$ \text{Var}(\bar{X}) = \tfrac{1}{81} \cdot 9 \cdot 100 = \tfrac{100}{9}. $$So $\bar{X} \sim N(150, \tfrac{100}{9})$, with $\sigma_{\bar{X}} = \tfrac{10}{3} \approx 3.33$, one-third of the individual SD (since $\sqrt{9} = 3$).
$$ P(\bar{X} > 154) = \text{normCdf}(154, 1000, 150, 10/3) \approx 0.1151. $$Compare to $P(X_{1} > 154) = \text{normCdf}(154, 1000, 150, 10) \approx 0.3446$: averaging makes large deviations much less likely.
题目:一家工厂称量苹果。每个苹果的重量 $X_{i} \sim N(150, 100)$(即 $\sigma = 10$ g),各苹果之间独立。一盒装 $9$ 个苹果。求样本均值 $\bar{X} = \tfrac{1}{9}\sum_{i=1}^{9} X_{i}$ 的分布,并计算 $P(\bar{X} > 154)$。
用线性组合规则,每一项的系数 $a_{i} = \tfrac{1}{9}$,共 $9$ 项:
$$ E(\bar{X}) = \tfrac{1}{9} \cdot 9 \cdot 150 = 150. $$ $$ \text{Var}(\bar{X}) = \tfrac{1}{81} \cdot 9 \cdot 100 = \tfrac{100}{9}. $$所以 $\bar{X} \sim N(150, \tfrac{100}{9})$,$\sigma_{\bar{X}} = \tfrac{10}{3} \approx 3.33$,正好是单个苹果标准差的三分之一(因为 $\sqrt{9} = 3$)。
$$ P(\bar{X} > 154) = \text{normCdf}(154, 1000, 150, 10/3) \approx 0.1151. $$对比 $P(X_{1} > 154) = \text{normCdf}(154, 1000, 150, 10) \approx 0.3446$:取平均后,大偏差的概率明显下降。
2. Subtracting variances. $\text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y)$ for independent RVs, always. Variances never subtract.
3. Using the independence-only variance rule without independence. If $X$ and $Y$ are correlated, $\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\,\text{Cov}(X, Y)$. Covariance is not needed in this unit; when a question does not state independence, check that it is a reasonable assumption before adding variances. 1. 缩放方差时忘记把系数平方:$\text{Var}(2X) = 4\,\text{Var}(X)$,不是 $2\,\text{Var}(X)$。
2. 把方差相减。独立随机变量始终满足 $\text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y)$:方差从不相减。
3. 没有独立性却套用独立性方差规则。若 $X$、$Y$ 相关,则 $\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\,\text{Cov}(X, Y)$。本单元不需要协方差(
covariance);若题目没有说明独立,先判断独立假设是否合理,再把方差相加。
Before combining, write what the new variable is in words and symbols, for example "$T = X_{1} + X_{2} + X_{3}$, the total mass of three independently chosen apples", and state "since $X$ and $Y$ are independent" where you add variances. Read carefully for "three different apples" (a sum of independent copies, variance $3\sigma^{2}$) versus "three times the mass of one apple" ($3X$, variance $9\sigma^{2}$). For a probability, finish by stating the full distribution, such as $T \sim N(450, 300)$, then enter $\sqrt{300}$, not $300$, as the standard deviation.
组合之前,先用文字和符号写出新变量,例如"$T = X_{1} + X_{2} + X_{3}$,即独立选取的三个苹果的总质量";把方差相加时写明"因为 $X$ 与 $Y$ 独立"。仔细区分"三个不同的苹果"(独立副本之和,方差 $3\sigma^{2}$)与"一个苹果质量的三倍"($3X$,方差 $9\sigma^{2}$)。求概率时,先写出完整分布,例如 $T \sim N(450, 300)$,再把 $\sqrt{300}$(而不是 $300$)作为标准差输入。
Temperatures $C$ in degrees Celsius have mean $20$ and standard deviation $3$. Find the mean and standard deviation of $F = 1.8C + 32$.摄氏温度 $C$ 的均值为 $20$、标准差为 $3$。求 $F = 1.8C + 32$ 的均值与标准差。
$E(F) = 1.8(20) + 32 = 68$. $\text{Var}(F) = 1.8^{2} \times 9 = 29.16$, so $\sigma_{F} = 1.8 \times 3 = 5.4$. The $+32$ does not affect the spread.
$E(F) = 1.8(20) + 32 = 68$。$\text{Var}(F) = 1.8^{2} \times 9 = 29.16$,故 $\sigma_{F} = 1.8 \times 3 = 5.4$。$+32$ 不影响离散程度。
$X$ has variance $4$. Compare $\text{Var}(X_{1} + X_{2})$, where $X_{1}, X_{2}$ are independent copies of $X$, with $\text{Var}(2X)$.$X$ 的方差为 $4$。比较 $\text{Var}(X_{1} + X_{2})$($X_{1}, X_{2}$ 是 $X$ 的独立副本)与 $\text{Var}(2X)$。
$\text{Var}(X_{1} + X_{2}) = 4 + 4 = 8$, but $\text{Var}(2X) = 2^{2} \times 4 = 16$. Two independent values partly offset each other; doubling one value doubles every deviation.
$\text{Var}(X_{1} + X_{2}) = 4 + 4 = 8$,而 $\text{Var}(2X) = 2^{2} \times 4 = 16$。两个独立取值会部分相互抵消;把一个取值加倍则会把每个偏差都加倍。
Apple masses are independent and $N(150, 100)$ in grams. Find the distribution of the total mass $T$ of $3$ apples and $P(T > 480)$.苹果质量(克)相互独立,服从 $N(150, 100)$。求 $3$ 个苹果总质量 $T$ 的分布与 $P(T > 480)$。
$T \sim N(3 \times 150,\; 3 \times 100) = N(450, 300)$, so $\sigma_{T} = \sqrt{300} \approx 17.32$. $P(T > 480) = P\!\left(Z > \tfrac{30}{17.32}\right) = P(Z > 1.732) \approx 0.0416$.
$T \sim N(3 \times 150,\; 3 \times 100) = N(450, 300)$,故 $\sigma_{T} = \sqrt{300} \approx 17.32$。$P(T > 480) = P\!\left(Z > \tfrac{30}{17.32}\right) = P(Z > 1.732) \approx 0.0416$。
Bolt lengths $B \sim N(50, 0.04)$ and hole depths $H \sim N(50.5, 0.05)$ are independent (mm). A bolt fits if $B < H$. Find the probability that a randomly chosen bolt fits a randomly chosen hole.螺栓长度 $B \sim N(50, 0.04)$ 与孔深 $H \sim N(50.5, 0.05)$(毫米)相互独立。若 $B < H$ 则螺栓合适。求随机选取的螺栓适合随机选取的孔的概率。
$D = H - B \sim N(0.5,\; 0.05 + 0.04) = N(0.5, 0.09)$, so $\sigma_{D} = 0.3$. $P(D > 0) = P\!\left(Z > \tfrac{0 - 0.5}{0.3}\right) = P(Z > -1.667) \approx 0.952$.
$D = H - B \sim N(0.5,\; 0.05 + 0.04) = N(0.5, 0.09)$,故 $\sigma_{D} = 0.3$。$P(D > 0) = P\!\left(Z > \tfrac{0 - 0.5}{0.3}\right) = P(Z > -1.667) \approx 0.952$。
Exam Strategy & Common Pitfalls考试策略与常见陷阱
- $E(X) = \sum x_i\, P(X = x_i)$ for discrete RVs
- $\text{Var}(X) = E(X^{2}) - \mu^{2}$ HL
- Binomial: $P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}$, mean $np$, var $np(1-p)$
- Standardization $Z = (X - \mu)/\sigma$ and $X = \mu + Z\sigma$
- $68$/$95$/$99.7$ empirical rule
- Continuous: $\int f = 1$, $E(X) = \int x f$, median is the $50\%$-area split HL
- $E(aX + b) = aE(X) + b$, $\text{Var}(aX + b) = a^{2}\text{Var}(X)$ HL
- Sum of indep. normals: means add, variances add (even for differences) HL
- 离散随机变量:$E(X) = \sum x_i\, P(X = x_i)$
- $\text{Var}(X) = E(X^{2}) - \mu^{2}$ HL
- 二项分布:$P(X = k) = \binom{n}{k} p^{k}(1-p)^{n-k}$,均值 $np$,方差 $np(1-p)$
- 标准化 $Z = (X - \mu)/\sigma$ 与反向公式 $X = \mu + Z\sigma$
- $68$/$95$/$99.7$ 经验法则
- 连续:$\int f = 1$,$E(X) = \int x f$,中位数为面积均分点 HL
- $E(aX + b) = aE(X) + b$,$\text{Var}(aX + b) = a^{2}\text{Var}(X)$ HL
- 独立正态之和:均值相加,方差也相加(求差时同样相加) HL
- Why $E(X)$ doesn't need to be a value $X$ can take
- Why variance squares deviations rather than absolute-valuing them HL
- The four binomial conditions and when they fail
- Why the GDC takes $\sigma$, not $\sigma^{2}$, even though the notation is $N(\mu, \sigma^{2})$
- Why $P(X = a) = 0$ for a normal (continuous) variable, so endpoints do not matter
- Variance always adds for independent RVs, even on a difference HL
- Why normals are closed under linear combinations HL
- $E(X)$ 为什么不必是 $X$ 真正能取到的值
- 方差为什么要把偏差平方而不是取绝对值 HL
- 二项分布的四个条件及它们何时失效
- 为什么 GDC 接受 $\sigma$ 而非 $\sigma^{2}$,尽管记号写作 $N(\mu, \sigma^{2})$
- 为什么正态(连续)变量满足 $P(X = a) = 0$,因而端点无关紧要
- 独立随机变量的方差始终相加,求差时也一样 HL
- 正态分布为何在线性组合下封闭 HL
Common Pitfalls常见陷阱
2. Confusing $\sigma$ and $\sigma^{2}$ in $N(\mu, \sigma^{2})$: feeding $\sigma^{2}$ into the GDC's
normCdf.3. "Top $10\%$" with invNorm: forgetting to use $p = 0.90$ rather than $0.10$.
4. Using a binomial when independence fails, for example sampling without replacement from a small population.
5. Forgetting the $1 - F(k - 1)$ off-by-one for $P(X \ge k)$ on a discrete CDF.
6. In a game, forgetting to subtract the stake when defining the net gain. 1. 离散随机变量的严格/非严格不等号:二项分布 $P(X < k) \ne P(X \le k)$。
2. 把 $N(\mu, \sigma^{2})$ 里的 $\sigma$ 与 $\sigma^{2}$ 混淆:错把 $\sigma^{2}$ 输入 GDC 的
normCdf。3. "前 $10\%$"用 invNorm 时忘了用 $p = 0.90$ 而非 $0.10$。
4. 独立性不成立时仍套用二项分布,例如从小总体中不放回抽样。
5. 求离散 CDF 上的 $P(X \ge k)$ 时漏掉"差一",写错 $1 - F(k - 1)$。
6. 游戏题中定义净收益时忘记减去赌注。
8. Subtracting variances on $X - Y$. Variances always add for independent RVs.
9. Forgetting to square the scale factor: $\text{Var}(2X) = 4\,\text{Var}(X)$, not $2\,\text{Var}(X)$.
10. Writing $P(X = a) > 0$ for a continuous RV: it is always $0$. 7. 算方差时把 $E(X^{2}) - \mu^{2}$ 写成 $E(X^{2}) - E(X)$。
8. 在 $X - Y$ 上把方差相减。独立随机变量的方差始终相加。
9. 忘记把缩放系数平方:$\text{Var}(2X) = 4\,\text{Var}(X)$,不是 $2\,\text{Var}(X)$。
10. 给连续随机变量写 $P(X = a) > 0$:它永远是 $0$。
Paper 1 (no technology) and Paper 2 (technology required) each last 2 hours and are each worth 30%; each has a compulsory Section A (short response) and Section B (extended response). Paper 3 (technology required, 1 hour, 20%) has two compulsory extended-response questions. The internal assessment, a mathematical exploration, is the remaining 20%. Since Paper 1 allows no technology, practise the algebraic results of this unit by hand: $E(X)$ and $\text{Var}(X)$ from a table, the rules for $E(aX + b)$ and $\text{Var}(aX + b)$, simple PDF integrals, and normal probabilities from the empirical rule and symmetry.
Paper 1(不允许使用技术工具)与 Paper 2(要求使用技术工具)各 2 小时,各占 30%;两份试卷都有必答的 Section A(短答)和 Section B(长答)。Paper 3(要求使用技术工具,1 小时,占 20%)有两道必答的长答题。其余 20% 是内部评估(internal assessment),即数学探究(mathematical exploration)。由于 Paper 1 不允许使用技术工具,本单元的代数结论要练到能手算:由分布表求 $E(X)$ 与 $\text{Var}(X)$,$E(aX + b)$ 与 $\text{Var}(aX + b)$ 的规则,简单的 PDF 积分,以及用经验法则和对称性求正态概率。
Paper 1 (no technology) and Paper 2 (technology required) each last 1 hour 30 minutes and are each worth 40%; each has a compulsory Section A (short response) and Section B (extended response). There is no Paper 3 at SL. The internal assessment, a mathematical exploration, is the remaining 20%. Since Paper 1 allows no technology, practise by hand: $E(X)$ and fair-game equations from a table, small binomial probabilities with $\binom{n}{k}$, and normal probabilities from the empirical rule and symmetry.
Paper 1(不允许使用技术工具)与 Paper 2(要求使用技术工具)各 1 小时 30 分钟,各占 40%;两份试卷都有必答的 Section A(短答)和 Section B(长答)。SL 没有 Paper 3。其余 20% 是内部评估(internal assessment),即数学探究(mathematical exploration)。由于 Paper 1 不允许使用技术工具,要练到能手算:由分布表求 $E(X)$ 并列公平游戏方程,用 $\binom{n}{k}$ 计算简单的二项概率,以及用经验法则和对称性求正态概率。
Flashcards闪卡
$P(|X - \mu| \le 2\sigma) \approx 0.95$
$P(|X - \mu| \le 3\sigma) \approx 0.997$
Unit D3: Practice QuizD3 单元:练习测验
Ten mixed-difficulty items. Items 2, 7, 8, 9 and 10 are HL only and are marked (HL); SL students can skip them. Your score updates in real time at the top of the page. Aim for 8/10 before exam day.
共 10 道难度混合题。第 2、7、8、9、10 题仅限 HL,已标注(HL);SL 学生可以跳过。分数会实时显示在页面顶端。考前目标:8/10 以上。
normCdf(85, 130, 100, 15).$85 = \mu - \sigma$,$130 = \mu + 2\sigma$。$-1\sigma$ 到 $+2\sigma$ 之间的面积 $\approx 0.819$,用 GDC normCdf(85, 130, 100, 15)。normCdf(24, 1000, 20, 3) $\approx 0.0912$.正确!$X + Y \sim N(12 + 8, 4 + 5) = N(20, 9)$,故 $\sigma = 3$。$P(X + Y > 24) = $ normCdf(24, 1000, 20, 3) $\approx 0.0912$。Readiness Checklist备考清单
Click each item you've mastered. Aim for 100% before exam day. Items marked (HL) are HL only; SL students can skip them.
每掌握一条就点击它。目标是考前 100% 达成。标有(HL)的项目仅限 HL;SL 学生可以跳过。
- SL 4.7 I can identify a discrete random variable, tabulate its distribution, and verify $\sum P = 1$.能识别一个离散随机变量,列出它的分布表,并核对 $\sum P = 1$。
- SL 4.7 I can compute $E(X) = \sum x_i\, P(X = x_i)$ from a table and interpret it as the long-run mean.能从分布表算出 $E(X) = \sum x_i\, P(X = x_i)$,并理解它是长期平均值。
- SL 4.7 I can solve "fair-game" problems by setting $E(\text{net gain}) = 0$.能用 $E(\text{net gain}) = 0$ 解决"公平游戏"类问题。
- SL 4.8 I can recognise the four binomial conditions and state $X \sim B(n, p)$ correctly.能辨识二项分布的四个条件,并正确写出 $X \sim B(n, p)$。
- SL 4.8 I can compute exact and tail binomial probabilities, including using the complement for $P(X \ge k)$.能计算二项分布的精确概率与尾部概率,包括用补集处理 $P(X \ge k)$。
- SL 4.8 I know $E(X) = np$ and $\text{Var}(X) = np(1-p)$ for binomial.能记住二项分布的 $E(X) = np$ 与 $\text{Var}(X) = np(1-p)$。
- SL 4.9 I can state the properties of $X \sim N(\mu, \sigma^{2})$ and use the $68$/$95$/$99.7$ rule.能陈述 $X \sim N(\mu, \sigma^{2})$ 的性质,并运用 $68$/$95$/$99.7$ 法则。
- SL 4.9 / 4.12 I can compute normal probabilities by GDC (
normCdf) and standardize using $Z = (X - \mu)/\sigma$.能用 GDC 的normCdf计算正态概率,并用 $Z = (X - \mu)/\sigma$ 做标准化。 - SL 4.9 / 4.12 I can use inverse normal to find percentiles and to solve for an unknown $\mu$ or $\sigma$ given a probability.能用反正态求百分位数,也能在已知概率的情况下反求未知的 $\mu$ 或 $\sigma$。
- AHL 4.14 (HL) I can compute $\text{Var}(X) = E(X^{2}) - \mu^{2}$ for a discrete RV and reproduce the algebraic derivation.(HL)能对离散随机变量算出 $\text{Var}(X) = E(X^{2}) - \mu^{2}$,并重现它的代数推导。
- AHL 4.14 (HL) I can verify a PDF, compute probabilities, $E(X)$, $\text{Var}(X)$, mode and median by integration.(HL)能验证一个 PDF,并通过积分算出概率、$E(X)$、$\text{Var}(X)$、众数与中位数。
- AHL 4.14 (HL) I can apply $E(aX + b) = aE(X) + b$ and $\text{Var}(aX + b) = a^{2}\text{Var}(X)$, and explain why the constant disappears in the variance.(HL)能运用 $E(aX + b) = aE(X) + b$ 与 $\text{Var}(aX + b) = a^{2}\text{Var}(X)$,并解释为什么常数项在方差里消失。
- AHL 4.14 (HL) I can use $E(X \pm Y) = E(X) \pm E(Y)$ and (for independent RVs) $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$, including remembering that variances add on a difference.(HL)能运用 $E(X \pm Y) = E(X) \pm E(Y)$,以及(独立随机变量的)$\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$,牢记求差时方差仍相加。
- AHL 4.14 (HL) I can identify the distribution of a linear combination of independent normals and use it to compute probabilities of sums, differences, and sample means.(HL)能识别独立正态的线性组合的分布,并用它计算和、差与样本均值的概率。
IB Paper-Style PracticeIB 试卷风格练习
IB exam-style questions: short-response and extended-response questions without technology (as on Paper 1) and with technology (as on Paper 2), plus HL extended problems. HL-only material (variance, continuous PDFs, linear combinations of RVs) is flagged. EMH difficulty mix. Use this after the in-page quiz and flashcards.
IB 考试风格题:不使用技术工具(同 Paper 1)与使用技术工具(同 Paper 2)的短答题和长答题,另有 HL 长题。HL 专属内容(方差、连续 PDF、随机变量的线性组合)已标注。难度按 EMH 分级。建议在做完本页测验与闪卡后再来。
How to use this guide本指南使用说明
How to use this guide本指南使用说明
Read only the dashed-gold "Cram-Mode Cheat" box at the top of each section, plus the formula boxes. Memorize the unit cheat-sheet. One sentence to carry: $E$ is the weighted mean, $\text{Var} = E(X^2) - \mu^2$, binomial means $np$, standardize normal with $Z = (X-\mu)/\sigma$. Skim one worked example per section. Do the unit quiz.
只看每节顶端的金色虚线 "Cram-Mode Cheat" 速记框,加上公式框(formula box)。把单元小抄背下来。一句话总结:$E$ 是加权平均(expected value),$\text{Var} = E(X^2) - \mu^2$,二项分布(binomial distribution)均值是 $np$,正态用 $Z = (X-\mu)/\sigma$ 做标准化(standardization)。每节挑一道例题(worked example)扫一遍,做完单元测验即可。
Read only the dashed-gold "Cram-Mode Cheat" box at the top of each section, plus the formula boxes. Memorize the unit cheat-sheet. One sentence to carry: $E$ is the weighted mean, the binomial has mean $np$ and variance $np(1-p)$, standardize a normal with $Z = (X-\mu)/\sigma$. Skim one worked example per section. Do the SL items of the unit quiz.
只看每节顶端的金色虚线 "Cram-Mode Cheat" 速记框,加上公式框(formula box)。把单元小抄背下来。一句话总结:$E$ 是加权平均(expected value),二项分布(binomial distribution)的均值是 $np$、方差是 $np(1-p)$,正态用 $Z = (X-\mu)/\sigma$ 做标准化(standardization)。每节挑一道例题(worked example)扫一遍,做完单元测验中的 SL 题即可。
Open every ▸ Going deeper. D3 moves from counting outcomes to thinking about whole distributions. The three HL ideas to internalize: (1) variance as the mean squared deviation, (2) linear transformations on $E$ and $\text{Var}$, (3) sums of independent normals are normal.
把每个 ▸ Going deeper 折叠块都展开来读。D3 从"计数结果"转向思考整个分布。三个必须内化的 HL 重点:(1) 方差(variance)即平均平方偏差;(2) $E$ 与 $\text{Var}$ 上的线性变换(linear transformation);(3) 独立正态分布之和仍是正态。
Open every ▸ Going deeper. D3 moves from counting outcomes to thinking about whole distributions. The three SL ideas to internalize: (1) $E(X)$ as a long-run mean, (2) checking the four binomial conditions before using $B(n, p)$, (3) turning any normal question into a sketch with a shaded area and a $z$-value.
把每个 ▸ Going deeper 折叠块都展开来读。D3 从"计数结果"转向思考整个分布。三个必须内化的 SL 重点:(1) $E(X)$ 是长期平均值;(2) 使用 $B(n, p)$ 前先核对二项分布的四个条件;(3) 把任何正态题都转化为一张带阴影面积和 $z$ 值的草图。
variance),而不是标准差(standard deviation);有些教材采用 $N(\mu, \sigma)$ 的写法。使用时务必声明所用约定。图形计算器(GDC)的正态函数要求输入 $\sigma$(标准差)而非 $\sigma^2$。